answersLogoWhite

0

You would use linked lists instead of arrays in two instances:

1) You don't know how long your list will be and it is apt to dramatically change length.

2) You will make lots of additions and removals in the middle of your list.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

To enter n nos without using arrays in c?

Use a linked-list.


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).


Where linked list using?

linked list are used for creation of stack,queues to use memory in optimum manner linked list are used as they are dynamic in nature


Can you use binary search on linked list elements?

No.


What is difference between linked list and singly linked list?

Answersingly linked list has the node inserted only at one end. and the pointer corresponds to the next pointer.but in a doubly linked list, the node pointer points to the both previous and the next node.singly linked list has two nodesdoubly linked list has three nodesA doubly linked list makes sense when you need to traverse the list in both directions. You aren't able to do that with a singly linked list.


What Linked list uses.type of memory allocation?

Linked lists use dynamic memory allocation (also called "heap memory allocation", as the linked list is stored in heap memory).


What is the purpose of avail list in linked list?

the purpose of avail list in link list is to use deleted nodes again


What is the PHP foreach construct used for?

The PHP foreach construct is used to iterate over arrays. This is done in the field of mathematics. It will issue errors when one tries to use it as a variable instead of arrays and objects.


Array in c plus plus must be defined at compil time?

No. Arrays can be defined at runtime, just as they can in C. It's just that it's generally more convenient to use vectors instead of dynamic arrays at runtime, thus arrays are generally used statically, at compile time.


How would you sort a linked list?

Use merge sortUse tree sort


Can we use doubly linked list as a circular linked list?

Yes. The tail node's next node is the head node, while the head node's previous node is the tail node.


What pointer type will you use to implement a heterogeneous linked list in c?

void pointer