Stack
|
Array
|
It may contain different data types. |
It contains the same data types. |
It is a linear data structure in which insertion (PUSH) and deletion (POP) can be done only from only one end ie Top. |
It is a linear Data Structure in which insertion and deletion can take place in any position. |
It is a static object. |
It is a dynamic object. |
In a stack, there's no random-access operation; there are only Push and Pop. |
Elements can be retrieved randomly in an array. |
It follows LIFO or FILO order. |
Data can be entered at any position and be read from any position. |
The element that is first entered would be the last removed. |
The element can be entered or removed in any order. |
![Data Structures - Stack Vs Array Stack](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCGQfY5UlVi-Yzoe-eBvMgMNw8nAu-TJbC065VaBZzipYsRtvVzLc41leMOxcoMwggftRlvkZzPyxOhXPNd3ef2OYNxFW24fzMAJsMNNh3k8xdQptBCkmbH-OsohxfeW3caSJcEGIoVMLI/s1600-rw/stack.png) |
Stack |
|
![Data Structures - Stack Vs Array array in c](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3AR1Rt_VMsMUSVJ3UJVQNuLFR2l5GUtushAvJILXUSN6ADyBin_1fbfpOOFK0fMApGge9DYd1CFmTeFFyj7AMQrb5Q8y-kwQtt51QlFCZmDPLODsJajcqfy_cTdXh26QsqH72ic1j_Aak/s200-rw/Untitled+Diagram+%25283%2529.jpg) |
Array |
|
Post a Comment