Akhil Sharma has Published 671 Articles

Golang program to implement Bellman ford algorithm

Akhil Sharma

Akhil Sharma

Updated on 05-Jul-2023 16:49:13

190 Views

The bellman ford algorithm is a graph traversal method that is used to find the shortest distance in a weighted network from a particular vertex to all the vertices. In this article, we will write a Go language program to implement Bellman ford algorithm. This algorithm is used to ... Read More

Golang program to create a priority queue

Akhil Sharma

Akhil Sharma

Updated on 05-Jul-2023 16:39:44

2K+ Views

A priority queue is a type of queue in which priorities are assigned to the elements and the elements with higher priority are popped out first than the elements with lower priority. In this article, we will write Golang programs to create a priority queue. They can be implemented using ... Read More

Golang program to find minimum value in a stack

Akhil Sharma

Akhil Sharma

Updated on 10-May-2023 12:46:25

194 Views

In Golang, we can find minimum value in a stack by using iterative method and optimized iterative method. A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle. Syntax func (s *Stack) getMin() int {…} The getMin() function is used to find the minimum value ... Read More

Golang program to find floor and ceil in binary search tree

Akhil Sharma

Akhil Sharma

Updated on 10-May-2023 12:44:21

146 Views

A binary search tree (BST) is a type of binary tree where every node has at most two children, commonly referred to as the left child and the right child. In this Golang article, we will learn how to find floor and ceil in binary search tree using recursion and ... Read More

Golang program to reorder list using recursion

Akhil Sharma

Akhil Sharma

Updated on 10-May-2023 12:43:12

121 Views

A linked list is a data structure consisting of a collection of nodes, where each node contains a value and a pointer to the next node in the list. In this Golang article, we will learn how to reorder list using recursion along with some helper functions. Syntax func ... Read More

Golang program to find the diameter of a tree

Akhil Sharma

Akhil Sharma

Updated on 10-May-2023 12:41:07

186 Views

In this Golang article, we are going to find the diameter of a tree by using recursion and iterative method. The diameter of a tree is the number of nodes on the longest path between any two leaves in the tree. Syntax func diameter(root *node) int{…} The diameter() function ... Read More

Golang program to delete duplicate value nodes from a sorted linked list

Akhil Sharma

Akhil Sharma

Updated on 10-May-2023 12:39:48

219 Views

In this Golang article, we are going to delete duplicate value nodes from a sorted linked list by using recursion and iterative method. A linked list is a data structure consisting of a collection of nodes, where each node contains a value and a pointer to the next node in ... Read More

Golang program to print left pascals triangle

Akhil Sharma

Akhil Sharma

Updated on 10-May-2023 12:36:56

157 Views

In this Golang article, we will learn how to print left Pascal’s triangle by using recursion and iterative method. Pascal's triangle is a triangular array of binomial coefficients. The left pascal's triangle is a variant of Pascal's triangle that is obtained by reflecting Pascal's triangle along a vertical axis. Syntax ... Read More

Golang program to find maximum element in array using linear search

Akhil Sharma

Akhil Sharma

Updated on 10-May-2023 12:17:27

2K+ Views

In this Golang article, we will learn how to find maximum element in array using linear search by using recursion and iterative method. Syntax func findMax(arr []int) int {…} The findMax() function is used to find maximum element in array using linear search iteratively. It takes an integer ... Read More

Golang program to find the first occurrence of a specific element in array using linear search

Akhil Sharma

Akhil Sharma

Updated on 10-May-2023 12:13:09

208 Views

In this Golang article, we will find the first occurrence of a specific element in array using linear search by using recursion and iterative method. Linear search is a simple search algorithm that checks every element in a list or array one by one, starting from the beginning, until a ... Read More

Advertisements