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


Please Help Members By Posting Answers For Below Questions

What is inheritance in simple words?

627


write a program that takes input in digits and display the result in words from 1 to 1000

1989


What is the problem with multiple inheritance?

586


What is purpose of inheritance?

645


What is constructor overloading in oop?

607






If a=5, b=6, c=7, b+=a%c*2. What is the final value of b?

944


How is polymorphism achieved?

587


can we make game by using c

3430


What are oops methods?

568


What is inheritance in oop?

604


Can you inherit a private class?

633


What are constructors in oop?

595


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?

1582


What is the diamond problem in inheritance?

579


Write a program to implement OOPS concepts such as inheritance, polymorphism, friend function, operator overloading?

4243