Computers & Internet Logo

Related Topics:

Posted on Feb 17, 2009

Adding and deleting an element in a stack and queue

In adding into stack top is the current top of the stack and n is its maximum size
the pseudocode is

begin
if top= n then stackfull;
top:=top+1;
stack(top) := item;
end:


in the deletion of stack remove top element from the stack stack and put it in the item
the pseudocode is

begin
if top = 0 then stackempty;
item := stack(top);
top := top-1;
end;

1 Answer

Anonymous

Level 1:

An expert who has achieved level 1.

  • Contributor 1 Answer
  • Posted on Feb 17, 2009
Anonymous
Contributor
Level 1:

An expert who has achieved level 1.

Joined: Feb 17, 2009
Answers
1
Questions
0
Helped
371
Points
1

Add Your Answer

×

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

381 views

Ask a Question

Usually answered in minutes!

Top Sun Computers & Internet Experts

Rob Hill
Rob Hill

Level 3 Expert

1483 Answers

Narseman

Level 3 Expert

1092 Answers

Brad Brown

Level 3 Expert

19190 Answers

Are you a Sun Computer and Internet Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...