Name an advantage of array over linked list?
Answer Posted / 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 |
Post New Answer View All Answers
What is inheritance in simple words?
write a program that takes input in digits and display the result in words from 1 to 1000
What is the problem with multiple inheritance?
What is purpose of inheritance?
What is constructor overloading in oop?
If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?
How is polymorphism achieved?
can we make game by using c
What are oops methods?
What is inheritance in oop?
Can you inherit a private class?
What are constructors in oop?
IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?
What is the diamond problem in inheritance?
Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?