×
My under eye areas maybe dark but my future will be bright and that is more important.
--Your friends at LectureNotes
Close

Data Structure using C

by Amit Pandey
Type: NoteDownloads: 3Views: 82Uploaded: 10 months agoAdd to Favourite

Share it with your friends

Suggested Materials

Leave your Comments

Contributors

Data Structures Using C++ VARSHA H. PATIL Head Computer Science and IT Engineering Department Matoshri College of Engineering and Research Centre Nashik 1 www.allitebooks.com
BRIEF CONTENTS Preface iv Acknowledgements Features of the Book vii viii 1. Fundamental Concepts 1 2. Linear Data Structure Using Arrays 32 3. Stacks 94 4. Recursion 147 5. Queues 168 6. Linked Lists 195 7. Trees 280 8. Graphs 372 9. Searching and Sorting 420 10. Search Trees 479 11. Hashing 527 12. Heaps 556 13. Indexing and Multiway Trees 589 14. Files 638 15. Standard Template Library 677 16. Algorithm Analysis and Design 714 Appendix: Overview of C++ Programming Index 759 797 www.allitebooks.com
DETAILED CONTENTS Preface iv Acknowledgements vii Features of the Book viii 1. Fundamental Concepts 1.1 1.2 1.3 Introduction to Programming 1 Object-oriented Programming 3 Introduction to Data Structures 3 1.3.1 Data 4 1.3.2 Data type 4 1.3.3 Data object 5 1.3.4 Data structure 5 1.3.5 Abstract data type 6 Types of Data Structures 9 1.4.1 Primitive and non-primitive data structures 9 1.4.2 Linear and non-linear data structures 9 1.4.3 Static and dynamic data structures 10 1.4.4 Persistent and ephemeral data structures 10 1.4.5 Sequential access and direct access data structures 11 Introduction to Algorithms 11 1.5.1 Characteristics of algorithms 12 1.5.2 Algorithmics 13 1.5.3 Algorithm design tools: Pseudocode and flowchart 13 Pseudocode 14 1.6.1 Pseudocode notations 14 1.6.2 Algorithm header 14 1.6.3 Purpose 15 1.6.4 Condition and return statements 15 1.6.5 Statement numbers 16 1.6.6 Variables 16 1.6.7 Statement constructs 17 1.6.8 Subalgorithms 18 Relationship among data, data structures, and algorithms 20 1.4 1.5 1.6 1.7 1 1.8 Implementation of data structures 1.9 Flowcharts 1.10 Analysis of Algorithms 1.10.1 Complexity of algorithms 1.10.2 Space complexity 1.10.3 Time complexity 1.10.4 Computing time complexity of an algorithm 1.10.5 Big-O notation 1.11 From Problem to Program 1.12 Software Engineering 1.12.1 Analysis phase 1.12.2 Design phase 1.12.3 Implementation phase 1.12.4 Testing phase 1.12.5 Verification phase 2. 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 Linear Data Structure Using Arrays Sequential Organization Linear Data Structure Using Sequential Organization: Arrays Array as an Abstract Data Type Memory Representation and Address Calculation Class Array 2.5.1 Inserting an element into an array 2.5.2 Deleting an element Arrays Using Template Multidimensional Arrays 2.7.1 Two-dimensional arrays 2.7.2 n-dimensional arrays Concept of Ordered List Single Variable Polynomial www.allitebooks.com 21 22 22 22 23 24 24 25 26 27 27 28 28 29 29 33 33 34 36 38 40 42 44 46 47 47 52 57 58
xii  Detailed Contents 2.9.1  Representation using arrays 2.9.2 Polynomial as array of structure 2.9.3  Polynomial evaluation 2.9.4  Polynomial addition 2.9.5  Polynomial multiplication 2.10 Array for Frequency Count 2.11 Sparse Matrix 2.11.1  Sparse matrix representation 2.11.2  Sparse matrix addition 2.11.3  Transpose of sparse matrix 2.12 String Manipulation Using Array 2.13 Pros and Cons of Arrays 2.13.1  Characteristics 2.13.2  Advantages 2.13.3  Disadvantages 2.13.4  Applications of arrays 58 60 61 62 66 69 70 72 73 77 84 89 89 89 90 90 3. Stacks 94 4.6 3.1 Concept of Stacks and Queues 3.2 Stacks 3.2.1  Primitive operations 3.3 Stack Abstract Data Type 3.4 Representation of Stacks Using Sequential Organization (Arrays) 3.4.1  Create 3.4.2  Empty 3.4.3  GetTop 3.4.4  Push 3.4.5  Pop 3.5 Stacks Using Template 3.6 Multiple Stacks 3.7 Applications of Stack 3.8 Expression Evaluation and Conversion 3.8.1 Polish notation and expression conversion 3.8.2 Need for prefix and postfix expressions 3.8.3  Postfix expression evaluation 3.9 Processing of Function Calls 3.10 Reversing a String with a Stack 3.11 Checking Correctness of Well-formed Parentheses 94 95 96 99 100 102 102 102 103 103 105 107 110 110 112 113 113 137 138 140 3.12 Recursion 3.13 Parsing Computer Programs 3.14 Backtracking Algorithms 3.15 Converting Decimal Numbers to Binary 140 142 142 4. Recursion 147 4.1 4.2 4.3 4.4 147 150 151 152 153 153 154 155 155 156 157 159 4.5 4.7 4.8 4.9 Introduction Recurrence Use of Stack in Recursion Variants of Recursion 4.4.1  Direct recursion 4.4.2  Indirect recursion 4.4.3  Tail recursion 4.4.4  Linear recursion 4.4.5  Tree recursion Execution of Recursive Calls Recursive Functions 4.6.1  Writing recursive code 4.6.2 Tower of Hanoi: An example of recursion 4.6.3  Checking for correctness 4.6.4  Things to remember Iteration Versus Recursion 4.7.1 Demerits of recursive algorithms 4.7.2  Demerits of iterative methods Simulating Recursion Using Stack (Eliminating Recursion) Applications of Recursion 142 159 161 162 162 162 163 163 164 5. Queues 168 5.1 5.2 5.3 5.4 168 169 170 176 Concept of Queues Queue as Abstract Data Type Realization of Queues Using Arrays Circular Queue 5.4.1 Advantages of using circular queues 5.5 Multi-queues 5.6 Deque 5.7 Priority Queue 5.7.1 Array implementation of priority queue www.allitebooks.com 180 180 181 182 185

Lecture Notes