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' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -