Avatar

Vishal Devxo

BFS traversal

BFS is similar to the level order traversal.BFS uses queues as a data structure and an array to implement BFS traversal of a graph BFS Algorithm Get an array of size of the number of vertices Initialize Queue is empty…

Introduction to C

Introduction to C language C language is a high-level language. It is both a general-purpose(to develop applications programs) and a specificpurpose(to develop System programs ) programming language. C is the most popular and commonprogramming language for every application developer. It…

DFS traversal

In DFS Traversal, we traverse up to the deepest vertex before backtracking. Since a graph doesn’t have a root node we can select any node s a start node. The node which we visit will be marked as visited so…

Graphs introduction

A graph(G) consists of two sets Vertices and Edges ‘V’ is finite, nonempty set of vertices which are called edges. V(G) and E(G) represent a set of vertices and edges of the graph ‘G’.We can also denote a Graph as…

Merge sort

Working of Merge sort Merge sort is one of the sorting algorithms, this follows Divide and Conquer rule to sort the given elements. In the merge sort, the unsorted array of size is divided into n subparts, these subparts are…

Insertion sort

Working of Insertion sort Insertion sort is sorting mechanism which is best then both bubble sort and selection sort. The elements in the array are compared with the preceding elements. In insertion sort array zeroth element is declared to be…

Selection sort

Working of Selection sort In selection sort, the comparison will be between two numbers from the starting of an array. the lesser will be left and a greater number will be right in ascending order.swapping of numbers will be done between…

Bubble Sort

Working of Bubble sort In bubble sorting, the comparison between two numbers takes place.there will be a sequence in comparison of the array elements. for ascending order first and second elements will be compared if the first element is greater…