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

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

Making Empty C++ Project: General exception (Exception from HRESULT:0x80131500) Visual Studio Community 2015 -

How to fix java warning for "The value of the local variable is not used " -