ADT, C, and Java

Source: Internet
Author: User

In the 5th chapter, the data abstraction allows the user programmer to get rid of the implementation details of the data type and only care about the interface of the data type when writing the client program. In computer science, there are some important data abstractions--data structures that should be introduced as early as possible. The data structure of computer science research includes linear table, stack, queue, set, graph, tree and so on.

Let's talk about the course of data structure and the realization of language.

"Data structure (c language version)" Min, 聯繫 is a classic textbook, the author in the preface is clearly explained:

In the book, C language is used as the description language of data structure and algorithm, and when describing the storage structure and algorithm, we should consider the features of C language, such as using the dynamic allocation of arrays to realize sequential storage structure. Although the C language is not an ideal description tool for abstract data types , in view of the current and nearly one or two years (note: Release 1997.4), "Object-oriented programming" is not a data structure of the first course, so the book does not directly adopt the class and object facilities, but from C A core subset is selected in the language, and the C + + language Reference Call parameter passing method is added, which forms a class C description language.  It makes the definition and implementation of various abstract data types concise and clear, not only in the details of C language, but also easily converted into C or C + + programs that can be executed on machine. ”

It's really weird why, until now, a lot of people are using C-language data structures. Although The data structure (C language Edition) is easy to convert it to a C or C + + program that can be executed on machine, it's easy for you to know what tool is called? The more convenient the better. If Java, C # is more convenient than C, you should choose java/C #. Nor is it a place to exercise abstract thinking? If you are not enough to learn advanced mathematics and discrete mathematics, you can observe the class of mathematics department.

In fact, yqj2065 want to say is: from the perspective of learning object-oriented, data structure is a good practice field, better than the GUI. That's why I put them in the 5th chapter, the list, the array, and the stack. Note that the introduction to programming is not a data structure course, so only the list of linked lists (linked lists) and Arrays (array) and stacks are introduced as familiar branch loops, object-oriented driving range.


abstract data type, ADT , is an important concept in the data structure course. And here it is an optional term.

The ADT that models the data structure, describes the following:(1) The collection of data elements, the relationship between the (2) elements, and (3) the operations owned by the ADT . We divide and conquer

(3) use a Java Interface I describes the operations owned by the ADT,

(2) A data type X (usually a node) is used to describe the data element of the ADT and to describe the relationship between the elements in relation to the objects of X .

(3) An implementation of the interface class manages the collection of elements.

Let's just say, "Abstract data types-a mathematical model and a set of operations defined on the model"-this is not the answer to the abstract data type, but the data type.

ADT is a mathematical model for a type of data structure with the same behavior-for example, the stack should have indentation and ejection behavior, or a mathematical model for a data type in multiple programming languages with similar semantics-such as a data type with integers in various languages.

the relationship between elements is the focus , and the closed system is usually described by a sequence pair . If the top element of the stack is ejected first, the relationship is reflected in the implementation code, and the relationship between the list elements is intuitive and is set by next.

Using Java to learn a data structure requires only 3 basic weapons: nodes, arrays, and strings.


ADT, C, and Java

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.