摘要:
There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity sh 阅读全文
摘要:
Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: 阅读全文
摘要:
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. 还是bst树,bst树的左节点小于根节点小于右节点,依据此性质递归比较既可以找到公共父节点。注 阅读全文
摘要:
Given a non empty string check if it can be constructed by taking a substring of it and appending multiple copies of the substring together. You may a 阅读全文
摘要:
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 阅读全文
摘要:
Given a binary search tree with non negative values, find the minimum absolute difference between values of any two nodes. 题目大意,求bst树任意两点的最小绝对距离。 思路,中 阅读全文
摘要:
Given a binary tree, you need to compute the length of the diameter of the tree. The diameter of a binary tree is the length of the longest path betwe 阅读全文
摘要:
You are given a string representing an attendance record for a student. The record only contains the following three characters: 'A' : Absent. 'L' : L 阅读全文
摘要:
Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute difference between the sum of all left subt 阅读全文
摘要:
Given an m n matrix M initialized with all 0's and several update operations. Operations are represented by a 2D array, and each operation is represen 阅读全文
摘要:
Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to h 阅读全文
摘要:
You need to construct a string consists of parenthesis and integers from a binary tree with the preorder traversing way. The null node needs to be rep 阅读全文
摘要:
You are given a data structure of employee information, which includes the employee's unique id, his importance value and his direct subordinates' id. 阅读全文