Why learn data structures

To improve your programming skills, decide to take a good look at data structures and algorithms. As for why SWIFT, because I’m an iOS developer, lol. Prefer swift.

Learning methods

  • Swift to transform the code of “Big Talk Data Structure”
  • For the first reading, from beginning to end, extract key points
  • Write algorithm implementation + appropriate exercises

Introduction to data structures

Data structure: A collection of data elements that have one or more specific relationships with each other

According to the viewpoint, we divide data structure into logical organization and physical structure.

  • Logical structure: The relationship between data elements in a data object
  • Physical structure: The form in which the logical structure of data is stored in a computer

Logical structure:

  • Collection structure: Data elements in a collection structure have no relationship other than that they belong to the same collection.
  • Linear structure: There is a one-to-one relationship between data elements in a linear structure
  • Tree structure: There is a one-to-many hierarchical relationship between data elements in a tree structure
  • Graph structure: The data elements of a graph structure are many-to-many relationships.

Physical structure:

  • Sequential storage structure: data elements are stored in contiguous storage units, and the logical and physical relationships between the data are consistent. (array)
  • Chain storage: The storage of data elements in any set of storage units, which can be contiguous or discontiguous. (Single linked list, double linked list)

The data type

Data type = set + operation

Data type: Refers to a set of values of the same nature and the operations defined on this set.

Abstract data type

Abstract Data Type (ADT) : REFERS to a mathematical model and the set of operations defined on it.

It is important to note that the definition of an abstract data type depends only on its set of logical properties, and has nothing to do with how it is represented and implemented inside the computer. Furthermore, abstract data types refer not only to data types that have been defined and implemented, but also to data types defined by computer programmers themselves. Standard format for abstract data types:

ADT Abstract Data Type Name Data Logical relationship between Data elements Definition Operation Operation 1 Initial conditions Operation Result Description Operation 2..... Operation of n... endADTCopy the code