Friday, January 2, 2015

Note: 九章算法

第2章
search in a range: 找的是2分法分别查找first position and last position

 做lintcode上binary search的题

search insert position

解释find K-th element里为何返回无穷大

rotated sorted array里如何找分割点,lgn

3步翻转: recover sorted array, rotate string, reverse words in a string(2步)

merge sort a linked list
------------------------------------------------------------------------------------
第3章 
partition array
merge sort, quick sort
lowest common ancestor
bfs, 3种方法
validate bfs,用divide and conquer
implement iterator for bfs(stack)
------------------------------------------------------------------------------------
第4章
sort list,可以用 partition list(from quick sort)
copy list with random pointer
convert sorted list to bst, bottom up
非递归考点: pre, in, post order tree traversal, permutation, subset
------------------------------------------------------------------------------------
第5章

No comments:

Post a Comment