
Premium
Title Page
1/29/2025
Copyright Page
1/29/2025
Dedication
1/29/2025
About the Authors
1/29/2025
Acknowledgements
1/29/2025
Preface
1/29/2025
Table of Contents
1/29/2025
1. Introduction
1/29/2025
1.1 Data Type
1/29/2025
1.2 Abstract Data Types
1/29/2025
1.3 Data Structures
1/29/2025
1.3.1 Linear and Non-Linear Data Structures
1/29/2025
1.3.2 Static and Dynamic Data Structures
1/29/2025
1.4 Algorithms
1/29/2025
1.4.1 Greedy Algorithm
1/29/2025
1.4.2 Divide and Conquer Algorithm
1/29/2025
1.4.3 Backtracking
1/29/2025
1.4.4 Randomized Algorithms
1/29/2025
1.5 Analysis of Algorithms
1/29/2025
1.5.1 Measuring Running Time of an Algorithm
1/29/2025
1.5.1.1 Experimental Method
1/29/2025
1.5.1.2 Asymptotic Analysis
1/29/2025
1.6 Big O Notation
1/29/2025
1.6.1 Rules for O Notation
1/29/2025
1.6.2 Finding Big O
1/29/2025
1.7 Tight and Loose Upper Bounds
1/29/2025
1.8 Finding Time Complexity
1/29/2025
1.9 Big O Analysis of Algorithms: Examples
1/29/2025
1.10 Worst Case, Average Case and Best Case Analysis
1/29/2025
1.11 Common Complexities
1/29/2025
Exercise
1/29/2025
2. Arrays
1/29/2025
2.1 One Dimensional Array
1/29/2025
2.1.1 Declaration of 1-D Array
1/29/2025
2.1.2 Accessing 1-D Array Elements
1/29/2025
2.1.3 Processing 1-D Arrays
1/29/2025
2.1.4 Initialization of 1-D Array
1/29/2025
2.1.5 1-D Arrays and Methods
1/29/2025
2.1.5.1 Passing Individual Array Elements to a Method
1/29/2025
2.1.5.2 Passing Whole 1-D Array to a Method
1/29/2025
2.2 Two Dimensional Arrays
1/29/2025
2.2.1 Declaration and Accessing Individual Elements of a 2-D array
1/29/2025
2.2.2 Processing 2-D Arrays
1/29/2025
2.2.3 Initialization of 2-D Arrays
1/29/2025
2.3 Arrays with More Than Two Dimensions
1/29/2025
2.4 Array Operations
1/29/2025
2.4.1 Traversal
1/29/2025
2.4.2 Search
1/29/2025
2.4.3 Insertion
1/29/2025
2.4.4 Deletion
1/29/2025
2.5 Problems on Arrays
1/29/2025
3. Linked Lists
1/29/2025
3.1 Single Linked List
1/29/2025
3.1.1 Traversing a Single Linked List
1/29/2025
3.1.2 Searching in a Single Linked List
1/29/2025
3.1.3 Insertion in a Single Linked List
1/29/2025
3.1.3.1 Insertion at the Beginning of the List
1/29/2025
3.1.3.2 Insertion in an Empty List
1/29/2025
3.1.3.3 Insertion at the End of the List
1/29/2025
3.1.3.4 Insertion in Between the List Nodes
1/29/2025
3.1.3.4.1 Insertion After a Node
1/29/2025
3.1.3.4.2 Insertion Before a Node
1/29/2025
3.1.3.4.3 Insertion at a Given Position
1/29/2025
3.1.4 Creation of a Single Linked List
1/29/2025
3.1.5 Deletion in a Single Linked List
1/29/2025
3.1.5.1 Deletion of First Node
1/29/2025
3.1.5.2 Deletion of the Only Node
1/29/2025
3.1.5.3 Deletion in Between the List Nodes
1/29/2025
3.1.5.3.1 Delete a Node Specified with Value
1/29/2025
3.1.5.3.2 Deletion of a Node at a Given Position
1/29/2025
3.1.5.4 Deletion at the End of the List
1/29/2025
3.1.6 Copy Constructor
1/29/2025
3.1.7 Reversing a Single Linked List
1/29/2025
3.2 Doubly Linked List
1/29/2025
3.2.1 Traversing a Doubly Linked List
1/29/2025
3.2.2 Searching an Element in a Doubly Linked List
1/29/2025
3.2.3 Insertion in a Doubly Linked List
1/29/2025
3.2.3.1 Insertion at the Beginning of the List
1/29/2025
3.2.3.2 Insertion in an Empty List
1/29/2025
3.2.3.3 Insertion at the End of the List
1/29/2025
3.2.3.4 Insertion in Between the Nodes
1/29/2025
3.2.3.4.1 Insertion After a Node
1/29/2025
3.2.3.4.2 Insertion Before a Node
1/29/2025
3.2.3.4.3 Insertion at a Given Position
1/29/2025
3.2.4 Creation of List
1/29/2025
3.2.5 Deletion from a Doubly Linked List
1/29/2025
3.2.5.1 Deletion of the First Node
1/29/2025
3.2.5.2 Deletion of the Only Node
1/29/2025
3.2.5.3 Deletion in Between the Nodes
1/29/2025
3.2.5.3.1 Delete a Node with Specified Value
1/29/2025
3.2.5.3.2 Deletion of a Node at a Given Position
1/29/2025
3.2.5.4 Deletion at the End of the List
1/29/2025
3.2.6 Copy Constructor
1/29/2025
3.2.7 Reversing a Doubly Linked List
1/29/2025
3.3 Circular Linked List
1/29/2025
3.3.1 Traversal of a Circular Linked List
1/29/2025
3.3.2 Insertion in a Circular Linked List
1/29/2025
3.3.2.1 Insertion at the Beginning of the List
1/29/2025
3.3.2.2 Insertion in an Empty List
1/29/2025
3.3.2.3 Insertion at the End of the List
1/29/2025
3.3.2.4 Insertion in Between the Nodes
1/29/2025
3.3.2.4.1 Insertion After a Node
1/29/2025
3.3.2.4.2 Insertion Before a Node
1/29/2025
3.3.2.4.3 Insertion at a Given Position
1/29/2025
3.3.3 Creation of Circular Linked List
1/29/2025
3.3.4 Deletion in Circular Linked List
1/29/2025
3.3.4.1 Deletion of the First Node
1/29/2025
3.3.4.2 Deletion of the Only Node
1/29/2025
3.3.4.3 Deletion in Between the Nodes
1/29/2025
3.3.4.3.1 Delete a Node Specified with Value
1/29/2025
3.3.4.3.2 Deletion of a Node at a Given Position
1/29/2025
3.3.4.4 Deletion at the End of the List
1/29/2025
3.3.5 Copy Constructor
1/29/2025
3.3.6 Reversing a Circular Linked List
1/29/2025
3.4 Linked List with Header Node
1/29/2025
3.5 Sorted Linked List
1/29/2025
3.6 Sorting a Linked List
1/29/2025
3.6.1 Selection Sort by Exchanging Data
1/29/2025
3.6.2 Bubble Sort by Exchanging Data
1/29/2025
3.6.3 Selection Sort by Rearranging Links
1/29/2025
3.6.4 Bubble Sort by Rearranging Links
1/29/2025
3.7 Merging
1/29/2025
3.8 Concatenation
1/29/2025
3.9 Cycle Detection and Removal in Linked List
1/29/2025
3.9.1 Insertion of a Cycle
1/29/2025
3.9.2 Cycle Detection
1/29/2025
3.9.3 Removal of Cycle
1/29/2025
3.10 Polynomial Arithmetic with Linked List
1/29/2025
3.10.1 Creation of Polynomial Linked List
1/29/2025
3.10.2 Addition of Two Polynomials
1/29/2025
3.10.3 Multiplication of Two Polynomials
1/29/2025
3.11 Comparison of Array Lists and Linked lists
1/29/2025
3.11.1 Advantages of Linked Lists
1/29/2025
3.11.2 Disadvantages of Linked Lists
1/29/2025
4. Stacks and Queues
1/29/2025
4.1 Stack
1/29/2025
4.1.1 Array Implementation of Stack
1/29/2025
4.1.2 Linked List Implementation of Stack
1/29/2025
4.2 Queue
1/29/2025
4.2.1 Array Implementation of Queue
1/29/2025
4.2.2 Linked List Implementation of Queue
1/29/2025
4.3 Circular Queue
1/29/2025
4.4 Deque
1/29/2025
4.5 Priority Queue
1/29/2025
4.6 Applications of Stack
1/29/2025
4.6.1 Reversal of String
1/29/2025
4.6.2 Checking Validity of an Expression Containing Nested Parentheses
1/29/2025
4.6.3 Method Calls
1/29/2025
4.6.4 Polish Notation
1/29/2025
4.6.4.1 Converting Infix Expression to Postfix Expression Using Stack
1/29/2025
4.6.4.2 Evaluation of Postfix Expression Using Stack
1/29/2025
5. Recursion
1/29/2025
5.1 Writing a Recursive Method
1/29/2025
5.2 Flow of Control in Recursive Methods
1/29/2025
5.3 Winding and Unwinding Phase
1/29/2025
5.4 Examples of Recursion
1/29/2025
5.4.1 Factorial
1/29/2025
5.4.2 Summation of Numbers from 1 to n
1/29/2025
5.4.3 Displaying Numbers from 1 to n
1/29/2025
5.4.4 Display and Summation of Series
1/29/2025
5.4.5 Sum of Digits of an Integer and Displaying an Integer as a Sequence of Characters
1/29/2025
5.4.6 Base Conversion
1/29/2025
5.4.7 Exponentiation of a Positive Integer
1/29/2025
5.4.8 Prime Factorization
1/29/2025
5.4.9 Greatest Common Divisor
1/29/2025
5.4.10 Fibonacci Series
1/29/2025
5.4.11 Checking Divisibility by 9 and 11
1/29/2025
5.4.12 Tower of Hanoi
1/29/2025
5.5 Recursive Data Structures
1/29/2025
5.5.1 Strings and Recursion
1/29/2025
5.5.2 Linked Lists and Recursion
1/29/2025
5.6 Implementation of Recursion
1/29/2025
5.7 Recursion vs. Iteration
1/29/2025
5.8 Tail Recursion
1/29/2025
5.9 Indirect and Direct Recursion
1/29/2025
6. Trees
1/29/2025
6.1 Terminology
1/29/2025
6.2 Definition of Tree
1/29/2025
6.3 Binary Tree
1/29/2025
6.4 Strictly Binary Tree
1/29/2025
6.5 Extended Binary Tree
1/29/2025
6.6 Full Binary Tree
1/29/2025
6.7 Complete Binary Tree
1/29/2025
6.8 Representation of Binary Trees in Memory
1/29/2025
6.8.1 Array Representation of Binary Trees
1/29/2025
6.8.2 Linked Representation of Binary Trees
1/29/2025
6.9 Traversal in Binary Tree
1/29/2025
6.9.1 Non Recursive Traversals for Binary Tree
1/29/2025
6.9.1.1 Preorder Traversal
1/29/2025
6.9.1.2 Inorder Traversal
1/29/2025
6.9.1.3 Postorder Traversal
1/29/2025
6.9.2 Level Order Traversal
1/29/2025
6.9.3 Creation of Binary Tree from Inorder and Preorder Traversals
1/29/2025
6.9.4 Creation of Binary Tree from Inorder and Postorder Traversals
1/29/2025
6.10 Height of Binary Tree
1/29/2025
6.11 Expression Tree
1/29/2025
6.12 Binary Search Tree
1/29/2025
6.12.1 Traversal in Binary Search Tree
1/29/2025
6.12.2 Searching in a Binary Search Tree
1/29/2025
6.12.3 Finding Minimum and Maximum Key
1/29/2025