Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Abstraction and Problem Solving with JAVA Walls and Mirrors Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Data Abstraction and Problem.

Similar presentations


Presentation on theme: "Data Abstraction and Problem Solving with JAVA Walls and Mirrors Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Data Abstraction and Problem."— Presentation transcript:

1 Data Abstraction and Problem Solving with JAVA Walls and Mirrors Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Data Abstraction and Problem Solving with JAVA: Walls and Mirrors Carrano / Prichard Tables and Priority Queues

2 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.1 An ordinary table of cities

3 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.2 The data fields for two sorted linear implementations of the ADT table for the data in Figure 11.1: a) array based; b) reference based

4 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.3 The data fields for a binary search tree implementation of the ADT table for the data in Figure 11.1

5 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.4 Insertion for unsorted linear implementations: a) array based; b) reference based

6 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.5 Insertion for sorted linear implementations: a) array based; b) reference based

7 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.6 The average-case order of the operations of the ADT table for various implementations

8 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.7a and 11.7b Some implementations of the ADT priority queue: a) array based; b) reference based

9 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.7c Some implementations of the ADT priority queue: c) binary search tree

10 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.8 A heap with its array representation

11 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.9a a) Disjoint heaps

12 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.9b b) a semiheap

13 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.10 Deletion for a heap

14 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.11 Recursive calls to heapRebuild

15 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.12 Insertion into a heap

16 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.13 a) The initial contents of anArray’s corresponding binary tree

17 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.14 Transforming an array anArray into a heap

18 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.15 Heapsort partitions an array into two regions

19 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.16a A trace of heapsort, beginning with the heap in Figure 11-14

20 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.16b A trace of heapsort, beginning with the heap in Figure 11-14

21 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.16c A trace of heapsort, beginning with the heap in Figure 11-14

22 Data Abstraction and Problem Solving with JAVA Walls and Mirrors; Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Figure 11.17 Array for Self-Test Exercise 2 and 7 and Exercise 17


Download ppt "Data Abstraction and Problem Solving with JAVA Walls and Mirrors Frank M. Carrano and Janet J. Prichard © 2001 Addison Wesley Data Abstraction and Problem."

Similar presentations


Ads by Google