This question is for \" Data Structure course \". ( check the image below ) I pr
ID: 3811963 • Letter: T
Question
This question is for "Data Structure course". (check the image below)
I prefer a brief answer & If you are going to use any programming language to solve this problem, then use JAVA language.
** Please don't provide a handwritten solution or a picture of the solution. Just post the answer here so I can read it easily.
** Answer the whole question not only just a part of it. So, you'll have to explain the advantge, and the comparison too as stated in the question.
Thanks in advance.
Problem 5. Compare between the simple sequential Array and the Linked Lists. Then explain the advantage of a data structure represented with links.Explanation / Answer
Elements can be accessed using index / subscript position.
Example: Elements can be randomly accessed like: Array[0], Array[5], etc.
Static Memory Allocation.
Because memory is allocated at compile time.
Dynamic Memory Allocation.
Insertion & deletion are fast & easy.
Advantages of linked list
1) It is Dynamic data Structure.
2) It can grow and shrink during run time.
3) Insertion and Deletion Operations on linked list are Easier.
3) Efficient Memory Utilization, because we don’t need to allocate memory at compilation time.
5) Linear Data Structures such as Stack, Queue can be easily implemented using Linked list.
6) We can move forward and backward with the help of doubly linked list.
7) Efficient memory utilization can be done using circular linked list.
Array Linked List Having same data type with common name for all the elements in array. All the elements are connected by links in case of linked list.Elements can be accessed using index / subscript position.
Example: Elements can be randomly accessed like: Array[0], Array[5], etc.
Elements can’t be accessed randomly but can be accessed only sequentially.Static Memory Allocation.
Because memory is allocated at compile time.
Dynamic Memory Allocation.
In linked list, memory is allocated at run time. Elements are stored in consecutive manner in memory. Elements can be stored at any available place. No pointers are used like linked list so no need of extra space in memory for pointer. Adjacency between the elements are maintained using pointers or links. So, pointers are used and for that extra memory space is needed. Array can be single dimensional, two dimension or multidimensional. Linked list can be singly, doubly or circular linked list. Insertion & deletion takes more time in array. Because elements are stored in consecutive memory locations.Insertion & deletion are fast & easy.
Because only value of pointer is needed to change.Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.