Name an advantage of array over linked list?
Answers were Sorted based on User's Feedback
Answer / jibran
in arrays direct access is possible where in linked list its not possible because all the time when we access an element we need pointers pointing to the memory location of that element...in short we can say that in linked list we are indirectly accessing the data but in arrays we are directly accessing the data...
Is This Answer Correct ? | 1 Yes | 1 No |
Answer / fias
Array data structure stored in stack memory, which means we
have allocation done at compile time and there is no complex
memory management required. Performance would be better if
we use array, but size is limited, we need to decide at
compile time.
Where as, linked lists are dynamic memory allocation, it
stored in Heap memory. Very flexible to handle it. But, it
requires memory management as we request more memory or
release memory at run time. Linked lists are best choice if
we don't know the memory requirement at run time.
Is This Answer Correct ? | 10 Yes | 12 No |
Answer / neha
Inserting and deleting elements is easier in array compared
to linked list.
In array, inserting element just requires incrementing the
next element by 1 and giving its previous index to new
element added. And deleting requires giving the element
which is after the element to b deleted an index one less to it.
But in linked list, link hs to be attached to p->next->next...
etc etc..
Is This Answer Correct ? | 8 Yes | 13 No |
What is polymorphism and example?
how to find no of instances of an object in .NET?
Round up a Decimal number in c++.. example Note = 3.5 is as 4 3.3 is as 3
3 Answers Accenture, Cognizant, IBM,
why function overloading is not called as pure polymorphism?
difine hierarchical inheritance.
What is polymorphism explain its types?
IN PROGRAMING LANGAUGE A C++ IS PURELY OBJECT ORIENTED OR NOT?
What Is a Polymorphism? How many types of polymorphism and whats that use in application?
what is virtual function?
26 Answers Aspire, HP, Infosys, RoboSoft, TCS,
WILL I GET A guaranteed JOB AFTER DOING bsc()IT) and GNIIT from an NIIT CENTRE??
21 Answers Biocon, MIT, NIIT,
define oops with class and object
Difference ways of Polymorphism?