To protect your data, the CISO officer has suggested users to enable 2FA as soon as possible.
Currently 2.7% of users enabled 2FA.

Commit 6adde28c authored by qinsoon's avatar qinsoon
Browse files

add some output to quicksort test

parent 4969b45f
......@@ -194,6 +194,9 @@ def test_quicksort():
lst, init_state = rand_list_of(n)
print "original list:"
print lst
with lltype.scoped_alloc(rffi.CArray(rffi.LONGLONG), n) as arr:
for i, k in enumerate(lst):
arr[i] = k
......@@ -201,12 +204,22 @@ def test_quicksort():
fnc(arr, 0, n - 1) # inplace sort
lst_s = sorted(lst)
print "expected list:"
print lst_s
print "result:"
for i in range(n):
print arr[i],
for i in range(n):
assert lst_s[i] == arr[i], "%d != %d" % (lst_s[i], arr[i])
def test_quicksort_partition():
def test_partition_in_quicksort():
# algorithm taken from Wikipedia
def swap(arr, i, j):
t = arr[i]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment