Skip to content
i3az0kimchi edited this page Nov 15, 2012 · 17 revisions

###About urlsort.py This program takes in a file containing a list of URLs, one per line, and produces an output file with the URLs in lexicographically sorted order. The user can choose from four provided sorting algorithms, plus four additional algorithms from Change My Mood (https://github.com/hunlan/cse403sortingoption), listed below. This program assumes that the URLs are well formed and contain only ASCII characters. URL validation has not yet been implemented.

###Languages Python 2.7, Python 3.3

###Usage Usage: urlsort.py -f [FILE] -s [sorting algorithm] -o [OUT]

Options:
  --version               show program's version number and exit
  -h, --help              show this help message and exit
  -v INT, --valid=INT     The type of URL validation to use (defaults to zero),
  	  		    	  	  0 = all URLs, 1 = valid URLs, 2 = invalid URLs
  -f FILE, --file=FILE    The FILE from which we will read
  -s ALG, --sort-alg=ALG  The type of sorting algorithm to use, 
                            1 = selection sort  
                            2 = heap sort  
                            3 = merge sort  
                            4 = radix sort
                            5 = binary sort (CMM)
                            6 = heap sort (CMM)
                            7 = insertion sort (CMM)
                            8 = merge sort (CMM)
  -o OUT, --output=OUT  The sorted output will be printed to OUT (defaults to 
                      'output.txt').

###Sorting

  • Selection sort O(n²)
  • Heap sort O(nlogn)
  • Merge sort O(nlogn)
  • Radix sort O(kN), where n is the number of buckets(256) and N the average key length
  • (CMM) Binary sort O(n²)
  • (CMM) Heap sort O(nlogn)
  • (CMM) Insertion sort O(n²)
  • (CMM) Merge sort O(nlogn)

###Team division

  • Caylan Lee - Output and writeup
  • Yoong Woo Kim - Radix sort
  • Andrew Davies - Heap sort
  • Ivan Darmansyah - Input
  • Peter Weisbeck - Selection sort
  • Brian Oliphant - Testing
  • Kyle Boone - Merge sort
Clone this wiki locally