
Depth-first-search
文章平均质量分 80
jialuyyy
这个作者很懒,什么都没留下…
展开
-
Word Search
Word SearchGiven a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizonta原创 2015-06-21 22:35:05 · 224 阅读 · 0 评论 -
Recover Binary Search Tree
Recover Binary Search TreeTwo elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n)原创 2015-07-02 22:09:17 · 276 阅读 · 0 评论 -
Kth Smallest Element in a BST
Kth Smallest Element in a BSTGiven 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 total e原创 2015-07-03 02:20:13 · 260 阅读 · 0 评论