What does the below algorithm do? def is(A): n = A.length for j in xrange(2, n+1): key = A[j] i = j - 1 while i > 0 and A[i] > key: A[i+1] = A[i] i -= 1 A[i + 1] = key
Insertion sort ?
I thought it was selection sort
\[\forall x\ \text{mathematician}(x) \implies \text{knowspython}(x)\] i think it's false
how come? every math guy I meet knows either Python, Mathematica, or MATLAB
or all 3 :-D
either \(\neq\) and
where did you get that algorithm?
topcoder.com
Learning from TC tutorials ?
yes
Good luck!:) and I think this is insertion sort check out the algorithm in here: http://en.wikipedia.org/wiki/Insertion_sort
I'll have lots to learn... I'm still a loser who thinks linked lists and arrays are the same thing.
and who compiles from the IDE... and who doesn't know how to use gcc make
lol, I too compile through the IDE and I know many topcoders and top coders who do the same.
Join our real-time social learning platform and learn together with your friends!