Created
March 29, 2014 02:07
-
-
Save rohitdholakia/9847053 to your computer and use it in GitHub Desktop.
Random data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
import random | |
import copy | |
#first for vanilla_quicksort, second for pivot that is midpoint, and third for random pivot selection | |
rand_data = [random.randint(0, 10000) for i in xrange(1000000)] | |
rand_mid = copy.deepcopy(rand_data) | |
rand_random = copy.deepcopy(rand_data) | |
#worst case for qs: reverse-sorted data | |
bad_data = sorted([random.randint(0, 10000) for i in xrange(1000000)], reverse = True) | |
bad_mid = copy.deepcopy(bad_data) | |
bad_random = copy.deepcopy(bad_data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment