1 / 16

Figure 13.1 Trace of a binary search for 78 in the data entry

Figure 13.1 Trace of a binary search for 78 in the data entry. Figure 13.2 Merging two sorted arrays. 124. 37. 45. null. Figure 13.3 A linked list. 124. 37. 45. null. 40. Figure 13.4 Adding 40 to the linked list of Figure 13.3. public LinkedList()

sawyere
Download Presentation

Figure 13.1 Trace of a binary search for 78 in the data entry

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Figure 13.1 Trace of a binary search for 78 in the data entry

  2. Figure 13.2 Merging two sorted arrays

  3. 124 37 45 null Figure 13.3 A linked list

  4. 124 37 45 null 40 Figure 13.4 Adding 40 to the linked list of Figure 13.3

  5. public LinkedList() Constructs an empty linked list, with the head, previous, and current nodes null. public boolean isEmplty() Returns true if the list is empty and false otherwise. public void insert(Object o) Creates a node containing the object o, inserting it before the current element. public void remove() Removes the current element. public Object getData() Gets the data field from the current element. Returns null if the current element is null. public boolean atEnd() Returns true if the current element is null and false otherwise. public void advance() If current is not null, advances the precious and current references. public void reset() Resets the current reference to refer to the head of the list. public void display() Prints each element of the list on a separate line. Figure 13.5 The operation of LinkedList class

  6. 15 7 12 top Figure 13.6 A stack growing from left to right

  7. top Figure 13.7 An empty stack

  8. 15 7 12 4 5 24 top Figure 13.8 A full stack

  9. 15 7 12 4 top Figure 13.9 Pushing 4 into the stack of Figure 13.6

  10. 15 7 12 4 top Figure 13.10 Popping the stack of Figure 13.9

  11. Figure 13.11 Evaluating the expression 7 8 + 4 5 + *(1/2)

  12. Figure 13.11 Evaluating the expression 7 8 + 4 5 + *(2/2)

  13. 4 17 6 back front Figure 13.12 A queue containing three elements

  14. 4 17 back 6 front Figure 13.13 A circular queue

  15. Figure 13.14 Identifiers and their types

  16. Figure 13.15 The Towers of Hanoi puzzle

More Related