240 发简信
  • Binary search

    通用写法

  • merge sort 归并排序

    basic merg sort给两个排好序的序列,将它们混合排序好 NlogN 利用递归实现merge sort: bottom up merg...

  • shellsort

    shell sort是insertion sort的一种,insertion sort每次只将元素移动一个位置,效率较低,shell sort采...

  • insertion sort

    从头开始的指针i,保证其左侧都是in order的,右侧都是not yet seen的。i++,若此数比i小,则与i交换,若还比起左边的小,则再...

  • selection sort

    从第一个开始,找到序列中最小的,和第一个交换;然后从第二个开始,找到最小的和第二个交换……O(N*N) selection sort 和inpu...

  • Stacks and Queues

    stack:last in first out (LIFO)queue: first in fist out (FIFO) stack API ...

  • Union-Find

    Quick Find 数组的每个位置存相应的节点id,相连接的节点的位置存相同的id。判断是否相连(connected)只需判断两位置的id是否...

  • You Don't Know JS: Scope & Closures Chapter 5: Scope Closure

    You Don't Know JS: Scope & Closures Chapter 5: Scope Closure We arrive a...

  • You Don't Know JS: Scope & Closures Chapter 4: Hoisting

    You Don't Know JS: Scope & Closures Chapter 4: Hoisting By now, you shou...