1146 Data Structures (Web design company) and Collections Chapter 23 Outline

1146 Data Structures and Collections Chapter 23 Outline 23.1 Introduction 23.2 Self-Referential Classes 23.3 Linked Lists 23.4 Stacks 23.5 Queues 23.6 Trees 23.6.1 Binary Search Tree of Integer Values 23.6.2 Binary Search Tree of IComparable Objects 23.7 Collection Classes 23.7.1 Class Array 23.7.2 Class ArrayList 23.7.3 Class Stack 23.7.4 Class Hashtable Summary Terminology Self-Review Exercises Answers to Self-Review Exercises Exercises 23.1 Introduction The data structures that we have studied thus far have had fixed size, such as single- and double-subscripted arrays. This chapter introduces dynamic data structures that grow and shrink at execution time. Linked lists are collections of data items lined up in a row users can make insertions and deletions anywhere in a linked list. Stacks are important in compilers and operating systems because insertions and deletions are made at only one end its top. Queues represent waiting lines; insertions are made at the back (also referred to as the tail) of a queue, and deletions are made from the front (also referred to as the head) of a queue. Binary trees facilitate high-speed searching and sorting of data, efficient elimination of duplicate data items, representation of file system directories and compilation of expressions into machine language. These data structures have many other interesting applications as well. We will discuss each of the major types of data structures and implement programs that create and manipulate them. We use classes, inheritance and composition to create and package these data structures for reusability and maintainability. The chapter examples are practical programs that will be useful in more advanced courses and in industrial applications. The programs devote special attention to and focus on reference manipulation. The exercises offer a rich collection of useful applications. 23.2 Self-Referential Classes A self-referential class contains a reference member that refers to an object of the same class type. For example, the class definition in Fig. 23.1 defines a type, Node. This type has two private instance variables integer data and Node reference next. Member next references an object of type Node, an object of the same type as the one being de
Note: In case you are looking for affordable webhost to host and run your servlet application check Vision mysql5 web hosting services

Leave a Reply