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

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -