Graph representation in data structure

A graph is a non-linear data structure that consists of vertices and edges.Vertices are also known as nodes. Edges can be in order or not. An ordered pair (u, v) indicates that there is an edge from vertex u to vertex v in a directed graph. Also in directed graph (u,v) is not equal to … Read more

Graph and types of graph in Data Structure

A graph is an abstract data structure that is basically a collection of a finite set of vertices (also called nodes) and edges that connect these vertices. A Graph is also known as a non-linear data structure because we can insert data anywhere by following some defined rule anywhere. Definition We can define graph G … Read more

AVL Tree in Data Structure with Explanation

An AVL tree is a self-balancing binary search tree. It was named AVL on its inventor Adelson-Velsky and Landis. There are some scenarios in the Binary search tree where complexity can go O(n) in the worst-case search. so to get search in O(log n) in worst case AVL tree is designed. Property of AVL tree … Read more

Radix Sort: Algorithm, Program, Explanation and Examples

Radix sort is a non-comparative sorting algorithm that sorts elements digit by digit starting from least significant digit to most significant digit. Suppose if you want to sort 10 elements in ascending order using radix sort, first sort the digit of unit place. After that sort the tenth place digit. This process will go till … Read more

Quick Sort Algorithm with explanation

Quick Sort is a very popular sorting algorithm also known as partition exchange sort. Quick sort follows divide-and-conquer strategy to sort an array elements. In this algorithm first we select the pivot element. This pivot element can be selected either the left most element or right most element. After selecting pivot element, first divide an … Read more

Bubble Sorting : Algorithm And Bubble Sort Program in C

Bubble sort is a simple sorting method to sorts the array elements. In the bubble sorting technique each array element is compared to the adjacent elements of the array. If the lower index value is greater than the highest index position of the array then swap these two adjacent values to maintain ascending sorting order. … Read more

Insertion Sort: Algorithm and Program in C

Insertion Sort is one of the simplest sorting algorithms that compare each array element with new elements that we want to insert in an array. It will insert a new element when found the correct position because the array should maintain order. Let’s understand it in brief Suppose you have an array of 5 cards … Read more

Selection Sort: Algorithm, Program in C

Selection Sort is a simple comparison-based sorting algorithm. It divides the input list into two parts: the sublist of items already sorted, which is built up from left to right at the front (left) of the list, and the sublist of items remaining to be sorted that occupy the rest of the list. Initially, the … Read more

Collision in Hashing and Collision Resolution Technique

In hashing technique, Collison is a situation when hash value of two key become similar. Suppose we want to add a new Record with key k in a hashtable, but index address H(k) is already occupied by another record. This situation is known as a collision. Example to understand the Collision Situation In the below … Read more