alg
sevenseablue
这个作者很懒,什么都没留下…
展开
-
2lgN for ditonic array search
2lgN for ditonic array search I have solutions for both the 3lgN and 2lgN algorithms for finding an element in a bitonic array. So if you are still working on this, don't read further. I've cod转载 2013-09-06 19:31:23 · 2175 阅读 · 1 评论 -
算法课_归并排序应用
Question 1 Merging with smaller auxiliary array. Suppose that the subarray a[0] to a[N-1] is sorted and the subarray a[N] to a[2*N-1] is sorted. How can you merge the two subarrays so that a[0] t翻译 2013-09-10 09:03:03 · 1388 阅读 · 0 评论 -
判断单链表是否存在环,判断两个链表是否相交问题详解
判断单链表是否存在环,判断两个链表是否相交问题详解 有一个单链表,其中可能有一个环,也就是某个节点的next指向的是链表中在它之前的节点,这样在链表的尾部形成一环。 问题: 1、如何判断一个链表是不是这类链表? 2、如果链表为存在环,如何找到环的入口点? 解答: 一、判断链表是否存在环,办法为: 设置两个指针(fast, slow),初始值都指向头,slow每次前转载 2013-09-05 12:04:59 · 665 阅读 · 0 评论