2019年7月12日

反转链表和反转链表2

摘要: LeetCode 206. Reverse Linked List Reverse a singly linked list. Example: Follow up: A linked list can be reversed either iteratively or recursively. C 阅读全文

posted @ 2019-07-12 16:08 zkfopen 阅读(367) 评论(0) 推荐(0) 编辑

基于partition的递归

摘要: partition算法可以应用在快速排序算法中,也可以应用到 Selection algorithm(在无序数组中寻找第K大的值) Partition 实现 快速排序中用到的 partition 算法思想很简单,首先从无序数组中选出枢轴点 pivot,然后通过一趟扫描,以 pivot 为分界线将数组 阅读全文

posted @ 2019-07-12 11:56 zkfopen 阅读(447) 评论(0) 推荐(0) 编辑

导航