answersLogoWhite

0


Best Answer

Push inserts a value onto the top of the stack.

Pop extracts the top value from the stack.

These are the two primary operations that can be performed upon a stack. Prior to popping a value, you will first check the stack is not empty, store the top value, then pop the stack. For a stack of type T, you might use the following:

if (!stack.empty()) {

T value {stack.top()}; // copy top value

stack.pop(); // remove value from stack

// use value...

}

User Avatar

Wiki User

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

Wiki User

12y ago

insert an item in data structure is known as a push operation....

push an element is stack means we are inserting an element into stack.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is push operation in data structure?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Which data structure is best suited for the undo operation in windows?

Stacks


What is merging operation in data structure?

Merging is combining the records in two different file into a single file.


Write data structure for creation operation on singly linked list?

typedef struct ListElement {struct ListElement *next;long data;} ListElement;


What data structure the pushand pop?

Push and pop are properties of a stack (also called a LIFO-- Last In, First Out-- queue).


What are the subject-matters of data structure?

types of data structure types of data structure


How do you amend a data structure?

How do you amend a data structure?


What are the stack operation?

there are two operations you can do with a STACK one is PUSH operation and the other is POP operation


What is the need of circular queue in data structures?

Circular queue is a linear data structure that follows the First In First Out principle. A re-buffering problem often occurs for each dequeue operation in a standard queue data structure. This is solved by using a circular queue which joins the front and rear ends of a queue.


What is homogeneous data structure?

collection of dissimilar type of data is called non homogeneous data structure as for example structure .


What is the difference between allocation and search data structure?

difference between serch data structure and allocation data structure


What is the weakness of Data structure diagram?

weakness of data structure diagrams


What is a homogeneous data structure and why is this a weakness for RDBMS?

in homogeneous data structure all the elements of same data types known as homogeneous data structure. example:- array