answersLogoWhite

0


Best Answer

Delete is mostly commonly known as pop in stack. The last element inserted into the stack is removed from the stack. Here is an illustration:

Consider the stack with the elements 1,2,3,4 inserted in order.

1->2->3->4

\

top


The top of the stack will be pointing to 4. When pop operation is performed, 4 is removed from the stack and the top is made to point to 3. The stack then becomes:

1->2->3

\

top

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the operation of delete in stack?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Is Recursion operation of the stack?

yes


Why insert operation in stack called as push operation?

Consider an array used as a stack. Align this array vertically. When an element is inserted into the stack, it is pushed all the way down despite the space availability at the top. Hence it is called push operation. Here's an illustration:Stack initially:|_||_||_||5|Stack after the insertion of 6:|_||_||6| - element pushed down as much as possible|5|


What is push operation in data structure?

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... }


Define list of operation on stack?

There are 4 main widely used stack operations.Operations:* POP - increase stack pointer and return top element * PUSH - putting element into stack's top * TOP - returns data of top element on stack * LENGTH/SIZE - returns number of elements inside stack For more detailed implementation details, please check web links.


Implement a class stack which simulates the operations of the stack allowing LIFO operationsAlso implement push and pop operations for the stack?

/* C program to implement stack. Stack is a LIFO data strcuture LIFO - Last in First Out Perform PUSH(insert operation), POP(Delete operation) and Display stack */#include #include #define MAXSIZE 5struct stack /* Structure definition for stack */{int stk[MAXSIZE];int top;};typedef struct stack STACK;STACK s;/* Function declaration/Prototype*/void push (void);int pop(void);void display (void);void main (){int choice;int option = 1;clrscr ();s.top = -1;printf ("STACK OPERATION\n");while (option){printf ("--------------\n");printf (" 1 -> PUSH \n");printf (" 2 -> POP \n");printf (" 3 -> DISPLAY \n");printf (" 4 -> EXIT \n");printf ("--------------\n");printf ("Enter your choice\n");scanf ("%d", &choice);switch (choice){case 1: push();break;case 2: pop();break;case 3: display();break;case 4: return;}fflush (stdin);printf ("Do you want to continue(Type 0 or 1)?\n");scanf ("%d", &option);}}/*Function to add an element to the stack*/void push (){int num;if (s.top -1){printf ("Stack is empty\n");return;}else{printf ("\nThe status of the stack is\n");for (i = s.top; i >= 0; i-){printf ("%d\n", s.stk[i]);}}printf ("\n");}byankit shukla

Related questions

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 stack operation in 8085 microprocessor?

STACK operation in 8085 microprocessor.The stack is a reserved area of the memory in RAM where temporary information may be stored. An 8-bit stack pointer is used to hold the address of the most recent stack entry. This location which has the most recent entry is called as the top of the stack.When the information is written on the stack, the operation is called PUSH. When the information is read from the stack, the operation is called POP. The stack works on the principle of Last in First Out or Fist in Lat Out


Is Recursion operation of the stack?

yes


What is stack in 8085 microprocessor?

STACK operation in 8085 microprocessor.The stack is a reserved area of the memory in RAM where temporary information may be stored. An 8-bit stack pointer is used to hold the address of the most recent stack entry. This location which has the most recent entry is called as the top of the stack.When the information is written on the stack, the operation is called PUSH. When the information is read from the stack, the operation is called POP. The stack works on the principle of Last in First Out or Fist in Lat Out


Write a c program to perform stack operation?

int top=-1; int stack[10];


Why insert operation in stack called as push operation?

Consider an array used as a stack. Align this array vertically. When an element is inserted into the stack, it is pushed all the way down despite the space availability at the top. Hence it is called push operation. Here's an illustration:Stack initially:|_||_||_||5|Stack after the insertion of 6:|_||_||6| - element pushed down as much as possible|5|


What is the function of the stack counter?

Its not a stack counter - its a stack pointer. The stack pointer is a register that points to the top of the stack. In the Intel configuration, it points to the next item to be popped off the stack. To push an item requires that the stack pointer be decremented first, and then the item is written. The inverse operation - the pop - requires read then increment.


Is scanf function follow the que or stack operation?

Your question makes no sense.


What does delete operation mean for excel?

It is an operation that removes characters, cell contents, worksheets, or files.


What is push operation in data structure?

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... }


What is a stack and how do you represent a stack in computer memory also discuss basic operation performed on a stack?

A stack is an abstraction of First-in-last-out, or the last in first out. The basic operations (may bear different names) Push or Add Pop or Next


Different operations done using rdbms?

different rdbms operations are delete,update easily and other u find on some other site. •Insert : unary operation •Delete : unary operation •Update : unary operation •Select : unary operation •Project : unary operation •Join : binary operation •Union : binary operation •Intersection : binary operation •Difference : binary operation