which data type can be represented using linked list
Answers
Explanation:
List (abstract data type)
In computer science, a list or sequence is an abstract data type that represents a countable number of ordered values, where the same value may occur more than once. ...
The name list is also used for several concrete data structures that can be used to implement abstract lists, especially linked lists and arrays.
Answer:
Array data type can be represented using linked list.
Explanation:
A Linked List is a linear data structure similar to arrays. arrays, linked list elements are not stored in a single location; instead, pointers are used to connect the elements. They are made up of a series of interconnected nodes. Each node stores the data as well as the next node's address.
- Arrays can be used to store similar types of linear data, but they have the following drawbacks.
- Because the size of the arrays is fixed, we must know the maximum number of elements ahead of time. In addition, regardless of usage, the allocated memory is always equal to the upper limit.
- In an array of elements, adding a new element or deleting an existing element is costly: Existing elements must be shifted to make room for the new elements, but in a linked list, if we have the head node, we can traverse to any node through it and insert a new node at the required position.
- For instance, if we keep a sorted list of IDs in an array id[], id[] = [1000, 1010, 1050, 2000, 2040] in a system. And if we want to add a new ID 1005, we'll have to move all the elements after 1000 to keep the sorted order (excluding 1000).
- Arrays are also expensive to delete unless you use some special techniques. To delete 1010 in id[, for example, everything after 1010 must be moved, which adds a lot of work to the code and reduces its efficiency.
Advantages over arrays include the following:
- Dynamic Array.
- Ease of Insertion/Deletion.