Data Structures and Algorithms - Chapter 3 -STACK ppt

Data Structures and Algorithms - Chapter 3 -STACK ppt

Data Structures and Algorithms - Chapter 3 -STACK ppt

... <integer> data <array of <DataType>> End Stack x x x x xx n count data 0 1 2 3 n-2 n-1 max-2 max-1 Stack with pre-defined maxsize and has n elements. n -1 top Physical … 25 push pop push ... element). 15 count top 1 pNew count top 0 pNew pNew->link = top top = pNew count = count + 1 Push Algorithm (cont.) <ErrorCode> Push (val DataIn <DataType>)...

Ngày tải lên: 06/03/2014, 17:20

31 556 0
Data Structures and Algorithms - Chapter 3 -Stack Applications pdf

Data Structures and Algorithms - Chapter 3 -Stack Applications pdf

... f)*g abc*+de + + * + ( - ( - * + - * ( - * ( - Infix Postfix a+b*c- (d*e / f)*g abc*+de* a+b*c- (d*e / f)*g abc*+de*f a+b*c- (d*e / f)*g abc*+de*f/ a+b*c- (d*e / f)*g abc*+de*f/ a+b*c- (d*e / f)*g abc*+de*f/g / ( - - / ( - * - Postfix abc*+de*f/g *- * - Process ... f)*g abc*+ a+b*c-(d*e / f)*g a a+b*c-(d*e / f)*g abc*+ a+b*c-(d*e / f)*g ab a+b*c-(d*e /...

Ngày tải lên: 06/03/2014, 17:20

37 622 0
Data Structures and Algorithms - Chapter 7 -Tree pptx

Data Structures and Algorithms - Chapter 7 -Tree pptx

... tree) Record Data <DataType> Parent <DataType> Flag <ChildType> End Record BinaryTree Data <Array of <Record> > End BinaryTree 0 1 2 3 4 5 6 Data A B E C F G H Parent - A B A C C F ... not NULL) 1. recursive_postOrder(subroot->left) 2. recursive_postOrder(subroot->right) 3. Operation(subroot-> ;data) End recursive_postOrder 30 Depth-Fir...

Ngày tải lên: 15/03/2014, 17:20

88 425 1
Data Structures and Algorithms - Chapter 8: Heaps pptx

Data Structures and Algorithms - Chapter 8: Heaps pptx

... else 1. MinData = Data[ 0] 2. Data[ 0] = Data[ count -1 ] 3. count = count - 1 4. ReheapDown(0, count -1 ) 5. return success End DeleteHeap 16 <ErrorCode> DeleteHeap (ref MinData <DataType>) ... (heap is not full) AND (more data in listOfData) 1. listOfData.Retrieve(count, newData) 2. data[ count] = newData 3. ReheapUp( count) 4. count = count + 1 3. if (count...

Ngày tải lên: 15/03/2014, 17:20

41 619 3
Data Structures and Algorithms - Chapter 9: Hashing pot

Data Structures and Algorithms - Chapter 9: Hashing pot

... Hoang Tru CSE Faculty - HCMUT Mid-square Address = middle digits of Key 2 • Example: 9452 * 9452 = 8 934 030 4 → 34 03 21 01 December 2008 Cao Hoang Tru CSE Faculty - HCMUT Mid-square • Disadvantage: ... Hoang Tru CSE Faculty - HCMUT Pseudorandom • Example: Key = 121267 a = 17 c = 7 listSize = 30 7 Address = ((17*121267 + 7) MOD 30 7 + 1 = (2061 539 + 7) MOD 30 7 + 1 = 206154...

Ngày tải lên: 06/03/2014, 17:20

54 592 1
Data Structures and Algorithms - Chapter 6 -Recursion pot

Data Structures and Algorithms - Chapter 6 -Recursion pot

... write (head-> ;data) 3. Print(head->link) // recursive case End Print 18 Print List in Reverse 19 Chapter 6 - Recursion  Subprogram implementation  Recursion  Designing recursive algorithms  ... Backtracking  Examples of backtracking and recursive algorithms:  Factorial  Fibonacci  The towers of Hanoi  Eight Queens Problem  Tree-structured program: Look-ahead in Ga...

Ngày tải lên: 15/03/2014, 17:20

85 532 1
Data Structures and Algorithms - Chapter 10: Sorting docx

Data Structures and Algorithms - Chapter 10: Sorting docx

... 1. 19 Chapter 10 - Sorting 1 Choosing incremental values Incremental values may be: 1, 4, 13, 40, 121, k t = 1 k i-1 = 3 * k i + 1 t = |log 3 (n)| -1 or : 1, 3, 7, 15, 31 , k t = 1 k i-1 = ... < count ) 1. temp = data current 2. walker = current-1 3. loop (walker >=0) AND (temp.key < data walker .key) 1. data walker+1 = data walker 2. walker = walker...

Ngày tải lên: 15/03/2014, 17:20

60 539 1
Data Structures and Algorithms - Chapter 12: Multiway trees pdf

Data Structures and Algorithms - Chapter 12: Multiway trees pdf

... > position) 1. subroot-> ;data i = subroot-> ;data i - 1 2. subroot->branch i + 1 = subroot->branch i 3. i = i + 1 3. subroot-> ;data position = entry 4. subroot->branch position + ... 10 11 M-Way Search Tree 12 13 14 15 B-Tree 16 17 B-Tree Insertion 18 B-Tree Insertion 19 Chapter 12  Lexicographic Search Trees: Tries  Multiway Trees  B-Tree, B*-Tree, B + -Tr...

Ngày tải lên: 15/03/2014, 17:20

44 491 0
Data Structures and Algorithms - Chapter 12: Multiway trees doc

Data Structures and Algorithms - Chapter 12: Multiway trees doc

... entryNdx + 1) 1 node -& gt; entries[shifter] = node -& gt; entries[shifter - 1] 2 shifter = shifter - 1 3 node -& gt; entries[shifter] = newEntry 4 node -& gt; numEntries = node -& gt; numEntries + ... Faculty - HCMUT B-Tree Insertion 11 else 1 insertEntry (rightPtr, entryNdx − minEntries, upEntry) 2 node -& gt; numEntries = node -& gt; numEntries − 1 3 ri...

Ngày tải lên: 15/03/2014, 17:20

31 496 2
w