摘要: 对单链表插入排序,给出个单链表的head节点;返回排完序的head节点;首先数据结构中习惯了以数组为参数排序,瞬间想到是遍历单链表存入arraylist中,再进行insert sort,(O(n**2)),space(O(n)),leetcode过不去;链表插入排序注意事项: 1:依次调用hea... 阅读全文
posted @ 2015-04-12 16:49 TomSun*star 阅读(219) 评论(0) 推荐(0) 编辑
摘要: Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.Callingnext()will return the next... 阅读全文
posted @ 2015-04-12 13:20 TomSun*star 阅读(125) 评论(0) 推荐(0) 编辑