Feedback for subjective question
Question 1: Calculate the complexity of the following sort procedure
sort( A[1..n] ) {
for i = 2 to n
do
for j = n downto i
do
if( A[j-1] > A[j] )
swap(A[j-1], A[j])
}
sort( A[1..n] ) {
for i = 2 to n
do
for j = n downto i
do
if( A[j-1] > A[j] )
swap(A[j-1], A[j])
}
Current Answer:
Be the first to post an answer to earn 100CR.