answersLogoWhite

0

Is stack a linear data structure?

Updated: 8/10/2023
User Avatar

Wiki User

11y ago

Best Answer

Yes. All object on a stack must be of the same type. However, the type may be a base class in which case all objects on the stack must either be of that type or be derived from that type. That is, if a circle, triangle and rectangle class are all derived from a common shape class, a stack of shapes would allow instances of all four types because they are all a type of shape.

User Avatar

Wiki User

8y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

13y ago

No.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

yes

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is stack a linear data structure?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is a stack in data structure?

A stack is a linear data structure that follows the Last In, First Out (LIFO) principle, where elements are added and removed from the same end called the top. Elements can only be added or removed from the top of the stack, making it a simple and efficient data structure for storing and accessing data.


What is the difference between a queue and a stack with example?

A stack is a data structure in which last item inserted is taken out first . That's why they are known as LIFO (last in first out). Inserting an item in stack is termed as push and taking an item out from stack I s termed as pop. Stack pointer is the pointer that points to the top of the stack or that points the item at the top of the stack and help in adding or deleting the item from the top of stack. The queue is a linear data structure where operations of insertion and deletion are performed at separate ends also known as front and rear. Queue is a FIFO structure that is first in first out. types of queues : circular, linear, double ended and priority


Which data structure convert logical to physical address?

Linear data structure is used to convert the logical address to physical address .Stack is used in this and the various conversion such as postfix,prefix and infix notation are come in this


Can stack be called fifo data structure?

No. A stack is a LIFO (Last In First Out) data structure.A queue is a FIFO (First In First Out) data structure.


How can you add different type of data in a stack?

stack is a linear data structure in which data item is either inserted or deleted at one end there are mainly two operations performed on stack.they're push poppush:writing a value to the stack is push or moving the stack pointer up to accomodatethe new item. pop:reading a value from stack or moving the stack pointer down.


What do an array and a stack have in common?

Both are linear data structures.


Explain The merits of using a deque to implement a stack in data structure?

Explain The merits of using a deque to implement a stack in data structure


What is the resource requirement of stack in a data structure?

no answer


What is non linear data strcuture?

A tree is an example for a non-linear data structure.


Which type of data structure is used in ATM to take the printout of last 5 transactions?

stack data structure.


Is String is a linear data structure?

yes


Is String a linear data structure?

yes it is, other linear data structures are lists,queues,stacks,arrays