11 Logical Structure:
A: The collection structure data elements have no other relationship than they belong to a collection
B: A one-to-one relationship between linear structure data elements
C: There is a one-to-many hierarchical relationship between tree-structured data elements
D: A Many-to-many relationship between graphical structure data elements
2 Physical Structure
A: Sequential storage structure is the data structure stored in the address continuous storage unit, the logical relationship between the database and the physical relationship is consistent
B: Chain storage structure is to store data structure in any storage unit, this group of storage units can be continuous, or can be discontinuous
Two algorithm large o derivation
1: With constant 1 represents all addition constants (execution time constant)
2: In the modified run Count function, only the highest stratum is retained
3: If the highest stratum is present and not 1, the constant multiplied by the item is removed
A constant order
int n=100,sum=0; A
sum = (1+n) *N/2; A
Time complexity O (1)
b Linear Order
for (i=0;i<n;i++) {/* Executes a statement with a time complexity of O (1) */}//n times
Time complexity O (n)
C Logarithmic order
int count=1;
while (count<n) {count = count*2}
Time complexity O (LOGN)
D Square Order
for (i=0;i<n;i++) {//n times
for (j=0;j<n;j++) {//n times
}
}
Time complexity O (n^2)
Common time complexity O (1) < O (Logn) < O (n) < O (Nlogn) < O (n^2) < O (n^3) < O (2^n) < O (n!) < O (n^n)
Data structure and algorithm (i.)