Data structures, algorithms, table summarizes linear

A data structure

1. Concept

1. The abstract data types and data types is a different concept.

2. The logical structure into linear structures (one to one), a tree structure (one to many), the graph structure (many).

3. The time complexity (T (n) = O (f (n)); the spatial complexity (memory footprint).

4. Algorithms

1.BF algorithm: worst time complexity is O (n * m).

2.kmp algorithm: worst time complexity of O (n + m).

II. TABLE linear

1. Concept

1. The address sequence table storage nodes formula: Loc (ai) = Loc (a1) + (i-1) * C.

2. The main operation is to find a sequence table, insert, delete operations for a linked list.

3. The storage density = (storage node data itself occupied) / (total amount of memory occupied by the whole structure of nodes).

4. Stack

1. Stack, also known as advanced after the table (LIFO table)

2. Basic Operation: initstack (s), a blank stack configuration; stackempty (s), determines whether the stack is empty; stackfull (s), determines whether or not the stack is full; push (s, x), into the stack; pop (s ), de-stacked; stacktop (s), taking the top element.

5. Queue

1. FIFO queue also called linear table (FIFO list).

2. Basic Operation: initqueue (q), construct an empty queue; queueempty (q), determines whether the queue is empty; queuefull (q), whether the queue is full; enqueue (q, x), enqueued; dequeue (q ), dequeue; queuefront (q), returns the head elements.

6. string

A node on the chain string may be stored to a plurality of characters.

2. Basic Operation: StrCompare (S, T), for comparing strings; Concat (& T, S1, S2), connected to two new strings of a string; SubString (& Sub, S, pos, len), Qiuzi string; StrInsert (& S, pos, T), the string is inserted; StrDelete (& S, pos, len), delete the string.

III. Troubleshooting Problems and Solutions

Difficult problems: next nextval not understand and
solve incidence: the Internet to find a blog post, to enhance understanding by Bowen
link: https://www.cnblogs.com/SYJ-521/p/7074702.html

Guess you like

Origin www.cnblogs.com/t----j/p/12584715.html