Skip to content

Files

Latest commit

 

History

History

week1 Merge sort

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Algo week 1: Merge sort

Divide-and-conquer is a great way to tackle down problems which seem hard to solve on surface. By recursively breaking down the original problem into sub-problems of same type, a divide and conquer algorithm solves the problem efficiently.

The idea of Merge sort is to divide a sequence into 2 sub-sequences, sort and then merge back into one sequence. The whole process is done recursively, and the running time cost is 6nlogn + 6n

###Scripts include:

  1. Merge sort for 1-D array
  2. Merge sort for 2-D array
  3. Closest pair in given points