Академический Документы
Профессиональный Документы
Культура Документы
@ McGraw-Hill Education
Copyrighted Material -Additional resource material supplied with the book Data Structures and Algorithms : Concepts, Techniques and Applications authored by G.A.V. Pai and published by
Tata McGraw Hill. This resource material is for Instructor's use only.
PROPRIETARY MATERIAL. 2008 The McGraw-Hill Companies, Inc. All rights reserved. No part of this PowerPoint slide may be displayed, reproduced or distributed
in any form or by any means, without the prior written permission of the publisher, or used beyond the limited distribution to teachers and educators permitted by McGraw-Hill
for their individual course preparation. If you are a student using this PowerPoint slide, you are using it without permission.
Outline
Introduction
Linked Stacks
Linked Queues
Top
b
a
front
(a) Conventional
representation of stack
a
rear
(d) Conventional
representation of a queue
Top
front
(b) Sequential
representation of stack
rear
Top
c
(c) Linked
representation of stack
procedure INSERT_LINKQUEUE(FRONT,REAR,ITEM)
Call GETNODE(X);
DATA(X)= ITEM;
LINK(X)= NIL;
/* Node with ITEM is ready to be
inserted into Q */
if (FRONT = 0) then FRONT = REAR = X;
/* If Q is empty then ITEM is the
first element in the queue Q */
else {LINK(REAR) = X;
REAR = X
}
end INSERT_LINKQUEUE.
10
11
Applications
Balancing symbols
Polynomial representation
12
13
COEFF
EXP
LINK
-2