We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Insertion Sort - Part 1
Insertion Sort - Part 1
Sort by
recency
|
883 Discussions
|
Please Login in order to post a comment
Here is my c++ solution, you can watch the explanatoin here : https://youtu.be/xFqneyHR96g
My C code 😎😂
Java easy code:
Why the below code is not correct .
Every Custom TC is working fine , but the Problem TCs are not passing
def insertionSort1(n, arr): # Write your code here j=n-2 temp=arr[n-1] while(j>=0): if(temp<=arr[j]): arr[j+1]=arr[j] print(' '.join(map(str,arr))) j-=1 else: arr[j+1]=temp print(' '.join(map(str,arr))) j-=1