Greedy method of solving problems involves a predefined procedure to follow to obtain the result.
Hashing is basically used for searching a key in an array.
Count sort is index based sorting algorithm. It is much faster than comparison based sorting technique but takes a lot more space.
We assume each element of the list/array as a separated list. Each single element is sorted by default so we merge down pair of elements using the merging two sorted arrays method.
Quick sort in C C++The popular oneAlso known as Selection-exchange sort, and Partition-exchange...
Start from the first element and iterate the array to find smallest element and swap first and that element.
Consider first element of the array as sorted then loop through remaining elements and perform insertion like inserting an element is done in a sorted array.
Bubble sort is one of the comparison based sorting algorithm.
Number of comparisons Number of swaps Adaptive behaviour - Checking if the data structure is already sorted or completely unsorted Stable - Maintaining order of duplicate values in sorted data structure Extra memory - Space Complexity
Circular linked list is similar to simple linked list, the main difference is that the last node points to the first node and not to null.
A doubly linked list is similar to simple linked list, the main difference is that a doubly linked list node has one extra pointer pointing to previous node.
Each node requires two data types, an int, char, float etc data type to store the value and a pointer to the next node to store the address of the node to which this node is pointing to.
We require a pointer to an array create it dynamically of inputed size from the user and a length of array till elements are present.
An array can be created in a matrix form with n number of rows and m no of columns by using the concept of multi dimensional array.
Create a new array pointer and copy the contents of previous array pointer to this new array pointer and free/delete the previous pointer.
Basics of Array Data Structures in C/C++. Arrays are collection of elements stored in continuous memory locations.
Introduction to heapHeap are complete binary tress. By complete, I mean each node except the leaf...
Binary search tree or BST is a node based tree in which each node has two children, we call it as left...