What is difference between static and dynamic array?



What is difference between static and dynamic array?..

Answer / Ankit Tyagi

A static array has a fixed size that cannot be changed once declared, while a dynamic array can resize itself to accommodate more elements as needed. In a static array, all memory for storing elements must be allocated at once, which can lead to wasted space if the exact size is not known in advance. Dynamic arrays can automatically allocate and deallocate memory, but each resizing operation incurs additional overhead.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Data Structures Interview Questions

What is difference between tree and binary tree?

1 Answers  


What is the complexity of bubble sort?

1 Answers  


Explain what is the bucket size, when the overlapping and collision occur at same time?

1 Answers  


State the advantages of using postfix notations?

1 Answers  


How many times is merge sort called?

1 Answers  


What is a minimum spanning tree?

1 Answers  


What is the use of sorting?

1 Answers  


What is a 2 dimensional array?

1 Answers  


Which one is faster? A binary search of an orderd set of elements in an array or a sequential search of the elements.

22 Answers   Syntel, TCS,


What is the difference between b tree and binary search tree?

1 Answers  


If you are given a choice to use either arraylist and linkedlist, which one would you use and why?

1 Answers  


What is the difference between hashmap and linkedhashmap?

1 Answers  


Categories