what is the use of using linked list and array?
Answer Posted / vaishnavi varadarajan
Use of array: All the elements are lumped together in one
block of memory. Individual elements can be accessed thru
Array index. Random access & Dynamic allocation are
possible.
Use of Linked list: Linked list allocates space for each
element separately in its own block of memory called
a "linked list element" or "node". It gets the overall
structure by using pointers to connect all its nodes
together like the links in a chain. Here the elements of
list can be accessed thru memory address (Since the pointer
stores a reference to another variable)which improves the
efficiency. Size of the list can also be modified (ie) we
can insert/delete elements of the list.
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is this infamous null pointer, anyway?
What does double pointer mean in c?
Why is c fast?
Is javascript based on c?
What is difference between %d and %i in c?
What is difference between constant pointer and constant variable?
When should we use pointers in a c program?
When should a type cast be used?
How are portions of a program disabled in demo versions?
What is a string?
write a program to find out prime number using sieve case?
What does %c mean in c?
Explain how do you determine a file’s attributes?
what are enumerations in C
Why is it important to memset a variable, immediately after allocating memory to it ?