上一页 1 ··· 18 19 20 21 22
摘要: Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia 阅读全文
posted @ 2016-03-13 08:30 YuriFLAG 阅读(147) 评论(0) 推荐(0)
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes 阅读全文
posted @ 2016-03-13 07:52 YuriFLAG 阅读(155) 评论(0) 推荐(0)
摘要: Given a collection of numbers that might contain duplicates, return all possible unique permutations. For example,[1,1,2] have the following unique pe 阅读全文
posted @ 2016-03-11 20:56 YuriFLAG 阅读(132) 评论(0) 推荐(0)
摘要: Given a collection of distinct numbers, return all possible permutations. For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3 阅读全文
posted @ 2016-03-11 20:39 YuriFLAG 阅读(229) 评论(0) 推荐(0)
摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possib 阅读全文
posted @ 2016-03-11 08:47 YuriFLAG 阅读(156) 评论(0) 推荐(0)
摘要: Given an integer array, find a subarray where the sum of numbers is zero. Your code should return the index of the first number and the index of the l 阅读全文
posted @ 2016-03-10 08:58 YuriFLAG 阅读(177) 评论(0) 推荐(0)
摘要: 考察插入排序的概念。思路:对于每一个带插入的节点要在以排序的节点中找到插入的位置。 每次都要从头遍历已经排序好的节点,需要将以排序好的节点与未排序好的节点断开。/* Sort a linked list using insertion sort. */ /** * Definition for Li 阅读全文
posted @ 2016-03-09 08:16 YuriFLAG 阅读(182) 评论(0) 推荐(0)
摘要: Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. For exam 阅读全文
posted @ 2016-03-06 21:35 YuriFLAG 阅读(255) 评论(0) 推荐(0)
上一页 1 ··· 18 19 20 21 22