Python program to find h.c.f. of two numbers using recursion

python program to Find H.C.F. Of Two Numbers Using Recursion

In this tutorial, we are going to learn writing python program to calculate the Highest Common Factor of two numbers. We will use recursion to calculate the HCF Problem Statement For any two numbers that are inputs given by the user, we have to calculate and print the h.c.f. of that numbers.  For example: Our … Read more

Linked list Deletion in Python: At beginning, End, Given location

Linked list Deletion in Python: At beginning, End, Given location

In this tutorial, we are going to learn the python program to create a singly linked list and delete a node at the beginning, at the end, and at the given location of the singly linked list. Problem Statement Our program will delete an element at the beginning, at the end, and at the given … Read more

Python program to insert a node in linked list

python program to Insert A Node In Linked List

In this tutorial, we are going to learn the python program to create a singly linked list and add a node at the beginning, at the end, and at the given location of the singly linked list. Problem Statement Our program will add an element at the beginning, at the end, and at the given … Read more

C Program to find highest frequency element in array

C Program To Find Highest Frequency Element In Array

In this tutorial we will learn writing C Program to find highest frequency element in array. Our program will print the array element which have repeated most times. There is one edge case where two elements might repeat same time. This type of case we are not handling in our code. C Program to find … Read more

C program to perform left rotation of array elements by two positions

C Program To Perform Left Rotation Of Array Elements By Two Positions

Performing left rotation in array means, our first element will become last element and shift each array elements towards left by one. Here we are going to perform left rotation by 2 times means we will shift each array element toward left two times. Our problem statement Suppose we have an array that has elements a={1,2,3,4,5}. … Read more

Kruskal’s Algorithm: Explanation, Example And Program

Kruskal’s Algorithm follows the Greedy Algorithm to construct a Minimum Spanning Tree for a connected, weighted, and undirected graph. This algorithm treats the graph as a forest and its vertices as an individual tree. The aim of this algorithm is to find a subset of the edges that forms a tree that includes every vertex … Read more

Prim’s Algorithm Explanation with Example

Prim’s algorithm uses the greedy approach to find a minimum cost spanning tree for a connected weighted undirected graph. The algorithm builds a tree that includes all vertex and a subset of the edges in such a way that the sum of all the edges weight in the tree is minimum. The major approach for … Read more

Difference between BFS and DFS Graph Traversal

Depth First Search (DFS) Depth First Search (DFS) algorithm traverses a graph in a depthward motion and uses a stack data structure to remember to get the next vertex to start a search when a dead end occurs in any iteration. Breadth First Search (BFS) Difference between BFS and DFS Breadth-First Search (BFS) Depth First … Read more

Graph Traversal Technique in Data Structure

Graph traversal is a technique to visit the each nodes of a graph G. It is also use to calculate the order of vertices in traverse process. We visit all the nodes starting from one node which is connected to each other without going into loop. Basically in graph it may happen some time visiters … Read more