answersLogoWhite

0


Best Answer

Linked lists are best suited to dynamic collections where random access is not a major concern, such as queues and stacks. Using an array would prove highly inefficient in these cases due to the need to resize the array to accommodate new elements or to remove unused elements. Occasionally, an increase in size will require the entire array be copied to a larger block of free memory. Linked lists don't have this problem as memory is allocated and de-allocated on a per element basis.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

Inserting into an array requires copying every element after the one you are inserting down one place, while inserting into a linked list just involves swapping a few pointers.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why linked list is best suited for insertion sort?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is best and worst case of time complexity and space complexity of insert and delete operation in singly linked list doubly linked list?

When inserting or extracting at the end of a singly-linked list or at the beginning or end of a doubly-linked list, the complexity is constant time. Inserting or extracting in the middle of a list has linear complexity, with best case O(1) when the insertion or extraction point is already known in advance and a worst case of O(n) when it is not.


What is the condition for the overflow in the linked lists?

In linked list if there is no any element inside it than we can say linked list is underflow.


Convert single linked list to double linked list?

You copy a singly linked list into a doubly linked list by iterating over the singly linked list and, for each element, calling the doubly linked list insert function.


How do you improve insertion sort algorithm?

If there was a way, it would be the new insertion sort! Theoretically you could reduce the time by using a linked list and searching to the position it needs to be inserted and inserting it. In practice however you would be better off simply using a different sort, especially if you don't want your data in a linked list. Selection sort is better when writing is expensive. Quicksort and Mergesort are faster on large data sets.


Advantage and disadvantage of linked list?

Linked list is a dynamic data structure that contains a "link" to the structure containing the next item. It is a collection of structures ordered not by their physical placement in memory (like array) but by logical links that are stored as part of the data in the structure itself.Advantages of Linked Lists- Dynamic structure (Mem. Allocated at run-time).- We can have more than one datatype.- Re-arrange of linked list is easy (Insertion-Deletion).- It doesn't waste memory.Disadvantages of Linked Lists- In linked list, if we want to access any node it is difficult.- It is occupying more memory.

Related questions

Which is the easy insertion operator single linked-list or double-linked list?

It is easier to insert into a singly linked list.


What is best and worst case of time complexity and space complexity of insert and delete operation in singly linked list doubly linked list?

When inserting or extracting at the end of a singly-linked list or at the beginning or end of a doubly-linked list, the complexity is constant time. Inserting or extracting in the middle of a list has linear complexity, with best case O(1) when the insertion or extraction point is already known in advance and a worst case of O(n) when it is not.


Can linked list represent in array if yes show how insertion and deletions can perform in array representation of inked list?

yes


Why you used link list in binary tree?

Linked list was introduced to reduce the space wastage done by array & also to make easier the insertion and deletion of elements from a list. A binary tree contains nodes of elements where insertion,deletion & searching is frequently done. So to make these operations easier linked list is used.


Which linked list can be randomly accessed by given locations?

In a word, none. Linked lists are sequential and must be traversed sequentially. For random access you need an array, but you lose the efficiency of a list when it comes to insertion/deletion.


What are the disadvantages of a linked list?

Linked lists use more memory than arrays, and finding an element in the list requires scanning the entire list instead of simply using a base pointer and index. As a result, linked lists are not well suited for data with a large number of elements. They are best used for a small number of elements that use a lot of space (relatively speaking).


What is the condition for the overflow in the linked lists?

In linked list if there is no any element inside it than we can say linked list is underflow.


Convert single linked list to double linked list?

You copy a singly linked list into a doubly linked list by iterating over the singly linked list and, for each element, calling the doubly linked list insert function.


How do you improve insertion sort algorithm?

If there was a way, it would be the new insertion sort! Theoretically you could reduce the time by using a linked list and searching to the position it needs to be inserted and inserting it. In practice however you would be better off simply using a different sort, especially if you don't want your data in a linked list. Selection sort is better when writing is expensive. Quicksort and Mergesort are faster on large data sets.


Advantage and disadvantage of linked list?

Linked list is a dynamic data structure that contains a "link" to the structure containing the next item. It is a collection of structures ordered not by their physical placement in memory (like array) but by logical links that are stored as part of the data in the structure itself.Advantages of Linked Lists- Dynamic structure (Mem. Allocated at run-time).- We can have more than one datatype.- Re-arrange of linked list is easy (Insertion-Deletion).- It doesn't waste memory.Disadvantages of Linked Lists- In linked list, if we want to access any node it is difficult.- It is occupying more memory.


Using doublelinked list insertion sort in c language?

using doublelinked list insertion sort in c language


What is the difference between doubly linked list and circular linked list?

A doubly linked list is a linked list in which each node knows where both of its neighbors are.A circular linked list is a linked list in which the "tail" of the list is linked to the "root". (Note that both the tail and root of the list are undefined/arbitrary in a circular linked list)Doubly linked lists are actually not necessarily related to circular linked list (aside from both being based on a linked list structure). In fact, you can have a circular doubly linked list, where each node knows where both of its neighbors are andwhere the list wraps around to connect to itself.