Given inorder and postorder traversal of a tree, construct the binary tree. Note:You may assume that duplicates do not exist in the tree. For example, ...
分类:
编程语言 时间:
2019-04-15 23:23:39
阅读次数:
214
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it. Note: You may assume k is always valid, 1 ≤ k ≤ BST's ...
分类:
其他好文 时间:
2019-03-31 14:07:00
阅读次数:
132
Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only ...
分类:
其他好文 时间:
2019-03-31 14:02:13
阅读次数:
144
Given an array of size n, find the majority element. The majority element is the element that appears more than ? n/2 ? times. You may assume that the ...
分类:
其他好文 时间:
2019-03-25 01:07:22
阅读次数:
185
Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1. Examples: Note: You may assume the ...
分类:
其他好文 时间:
2019-03-24 10:02:12
阅读次数:
119
Given two strings s and t , write a function to determine if t is an anagram of s. Example 1: Example 2: Note:You may assume the string contains only ...
分类:
其他好文 时间:
2019-03-21 21:41:27
阅读次数:
165
Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is define ...
分类:
其他好文 时间:
2019-03-21 00:42:03
阅读次数:
156
Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has enough space (size that is greater or equ ...
分类:
其他好文 时间:
2019-03-20 20:48:27
阅读次数:
183
Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are ...
分类:
其他好文 时间:
2019-03-17 11:01:49
阅读次数:
149
题目内容如下: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1: Example 2: 虽然是暴 ...
分类:
其他好文 时间:
2019-03-11 23:47:07
阅读次数:
166