![]() ![]() 16.3: The Stack ADT A stack is a special type of list that allows insertions and removals to be performed only to the front of the list.Keep in mind that there are other implementations that could have been described. 16.2: OBJECT-ORIENTED DESIGN: The List Abstract Data Type (ADT) The PhoneList example from the previous section illustrates the basic concepts of the linked list.In this section, we will develop a dynamic list, which is a data structure whose elements are arranged in a linear sequence. By contrast, a dynamic structure is one that can grow and shrink as needed. ![]() 16.1: The Linked List Data Structure As we said, a static data structure is one whose size is fixed during a program’s execution-a static structure’s memory is allocated at compile time.Finally, the binary tree data structure that is used in the Java Collections Framework will be studied briefly. The data structure classes in this library make use of a new Java construct, called generic types. Then the Java Collections Framework implementation of numerous data structures in the java.util package will be described. This chapter describes how to implement a linked list and how to use inheritance to extend the list to implement the stack and queue structures. Some of these structures-linked lists, stacks, queues, binary trees, hash tables-have become classic objects of study in computer science. For more advanced problems, it is often necessary to develop specialized structures to store and manipulate information. These are only two of the many data structures developed by computer scientists. However, unlike arrays, a vector is an example of a dynamic structure-that is, one that can grow and shrink during a program’s execution. Like an array, individual vector elements are accessed by their position. Tatic.) The Vector class from Chapter 9 is another example of a data structure. (This is a different meaning of static than the Java keyword static.) An array is an example of a static structure, because its size is fixed for the duration of the program’s execution. If you remember, an array is an example of a data structure in which all of the data are of the same type or class and in which individual elements are accessed by their position (index or subscript). You are already familiar with one type of data structure-arrays, which we discussed in Chapter 9. \)Ī data structure is used to organize information that a computer can access and process easily and efficiently. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |