In insertion sort which is faster array implemantation or linked list implementation | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

In insertion sort which is faster array implemantation or linked list implementation

23rd Apr 2017, 8:19 AM
Akshay S A
3 Answers
+ 12
Actually Both are Same As linked list is a same as a array it will act same as a array does in any kind of Sorting system.
23rd Apr 2017, 11:56 AM
Dipan Nanda
Dipan Nanda - avatar
+ 2
OK thanks
23rd Apr 2017, 12:14 PM
Akshay S A
+ 1
actually both are not same. it depends upon in which way you are implementing it. if you are inserting all the elements in one go and then sort it. it is kind of same for both, if you are sorting whenever a new element is inserted it will be "much" faster in linked list. also if you want to make array implementation more faster instead of checking for array index ever time in loop you can simply just check for array out of bounds exception. its just a fun thing i discovered few days ago.
23rd Apr 2017, 8:23 PM
Adarsh Chaudhary
Adarsh Chaudhary - avatar