chapter 9 GRAPH ALGORITHMs $I Definitions e G(V,E) where G: =graph, V=V(G): :=finite nonempty set of vertices, andE=E(G): : = finite set of edges. d' Undirected graph:(V;,vi)=(j,vi): =the same edge 6 Directed graph(digraph): :=2* I tailhead
CHAPTER 4 Stacks and Queues SI The stack adt 1. ADT A stack is a Last-In-First-Out(LIFO)list, that is. an ordered list in which insertions and deletions are made at the top only Objects: A finite ordered list with zero or more elements
(1) Input There are zero or more quantities that are externally supplied. (2) Output At least one quantity is produced. (3) Definiteness Each instruction is clear and unambiguous. (4) Finiteness If we trace out the instructions of an algorithm, then for all cases, the algorithm terminates after finite number of steps. (5) Effectiveness Every instruction must be basic enough to be carried out, in principle, by a person using only pencil and paper. It is not enough that each operation be definite as in(3); it also must be feasible