随笔分类 - LeetCode
摘要:对单链表插入排序,给出个单链表的head节点;返回排完序的head节点;首先数据结构中习惯了以数组为参数排序,瞬间想到是遍历单链表存入arraylist中,再进行insert sort,(O(n**2)),space(O(n)),leetcode过不去;链表插入排序注意事项: 1:依次调用hea...
阅读全文
摘要: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...
阅读全文

浙公网安备 33010602011771号