Which type of data structure is a stack? -


i got 1 simple question: kind of data structure stack? static or dynamic data structure? looking answer , couldn't find it, therefore got own "explanation" - guess, when can implement either using array or linked list, can be... both?, depending on implementation? reasoning make sense?

by definition, static data structure has fixed size. if can limit size of stack pre-determined number, stack becomes static data structure. size size of storage, plus size of stack pointer or stack index indicating current location.

a stack of unlimited capacity dynamic data structure, regardless of implementation. implemented linked list or array re-allocate upon reaching capacity, size of such stack changes add or remove data.


Comments

Popular posts from this blog

Google sheets equipment borrowing system -

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

c# - Convert type 'System.Collections.Generic.List<string>' to 'System.Collections.Generic.IList<>' -