摘要: 【Description】 Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4, 阅读全文
posted @ 2019-09-19 19:27 ___Moongazer 阅读(124) 评论(0) 推荐(0)
摘要: 【Description】 Given two binary trees, write a function to check if they are the same or not. Two binary trees are considered the same if they are stru 阅读全文
posted @ 2019-09-18 17:58 ___Moongazer 阅读(155) 评论(0) 推荐(0)
摘要: 【题目描述】 输入某二叉树的前序遍历和中序遍历的结果,请重建出该二叉树。假设输入的前序遍历和中序遍历的结果中都不含重复的数字。例如输入前序遍历序列{1,2,4,7,3,5,6,8}和中序遍历序列{4,7,2,1,5,3,8,6},则重建二叉树并返回。 时间限制:1秒 空间限制:32768K 【AC代 阅读全文
posted @ 2019-09-17 17:36 ___Moongazer 阅读(100) 评论(0) 推荐(0)
摘要: 【问题描述】 输入一个链表,按链表从尾到头的顺序返回一个ArrayList。 时间限制:1秒 空间限制:32768K 【AC代码】 一、链表+递归 1 import java.util.ArrayList; 2 public class Solution { 3 ArrayList<Integer> 阅读全文
posted @ 2019-09-16 17:31 ___Moongazer 阅读(121) 评论(0) 推荐(0)
摘要: 【题目描述】 请实现一个函数,将一个字符串中的每个空格替换成“%20”。例如,当字符串为We Are Happy.则经过替换之后的字符串为We%20Are%20Happy。 时间限制:1秒 空间限制:32768K 【AC代码】 一、调用自带函数 1 public class Solution { 2 阅读全文
posted @ 2019-09-15 16:30 ___Moongazer 阅读(112) 评论(0) 推荐(0)
摘要: 【Description】 Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number 阅读全文
posted @ 2019-09-14 19:41 ___Moongazer 阅读(121) 评论(0) 推荐(0)
摘要: 【Description】 Implement int sqrt(int x). Compute and return the square root of x, where x is guaranteed to be a non-negative integer. Since the return 阅读全文
posted @ 2019-09-13 19:19 ___Moongazer 阅读(126) 评论(0) 推荐(0)
摘要: 【Description】 Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were 阅读全文
posted @ 2019-09-12 11:04 ___Moongazer 阅读(102) 评论(0) 推荐(0)
摘要: 题目链接:https://www.nowcoder.com/practice/abc3fe2ce8e146608e868a70efebf62e?tpId=13&tqId=11154&tPage=1&rp=1&ru=/ta/coding-interviews&qru=/ta/coding-interv 阅读全文
posted @ 2019-09-11 09:52 ___Moongazer 阅读(180) 评论(0) 推荐(0)