
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 33676 Articles for Programming

598 Views
In this article we are going to understand how to use methods naming brute-force, sliding window and prefix sum methods of golang to find the maximum sum of a subarray with length k. We will also discuss the Algorithm for each method and provide code Examples to demonstrate their implementation. Syntax func len(v Type) int The len() function is used to get the length of a any parameter. It takes one parameter as the data type variable whose length we wish to find and returns the integer value which is the length of the variable. Example 1 The first ... Read More

355 Views
In this article we are going to understand how to creat a golang program to traverse a circular linked list and print it’s element using simple for and while loop. Circular linked lists are a type of data structure where the last element of the list is connected to the first element, forming a loop. Algorithm Step 1 − First, we need to import the fmt package. This struct contains a data variable to store data along with a pointer variable to store the address of the next node. Step 2 − Then create a function called Traverse() to ... Read More

621 Views
In this article we will learn to develop a go language program to implement the bucket sort through using custom sorting Algorithm. In Bucket sort we sort the unsorted array in different bucket every bucket contains a wide range of elements. The elements present in each bucket are then sorted by using a different sorting Algorithm, such as insertion sort or quicksort. Then the sorted buckets are merged back together. Algorithm Step 1 − First, we need to import the fmt package. Then create a function called bucketSort() which accepts the array to be sorted as an argument and ... Read More

720 Views
In this article we will learn how to write a go language program to implement circular linked list using struct and slice method. circular linked lists are created in such a way that each node of the linked list points to the next node and the last node points again to the starting node. Example 1 In this Example we will write a go language program to implement the circular linked lists by using a struct to store each node of the list. package main import "fmt" type Node struct { data int ... Read More

426 Views
In this article we are going to learn how to use Binary Heap method and Priority queue method to implement prims Algorithm in golang. Prim's Algorithm is used to find the minimum spanning tree of a weighted undirected graph. Algorithm Step 1 − First, we need to import the fmt and heap package. Then create the required structs and functions and define properties to them. Step 2 − Further Initialize an empty visited set and a binary heap h with the minimum edge from the starting vertex s. Step 3 − Then create the main() function. Inside the function ... Read More

428 Views
In this article we are going to understand how to develop a golang program to implement kruskals Algorithm with the help of union-find Algorithm and priority queue approach. Kruskal's Algorithm is used to find the minimum spanning tree of a graph. Algorithm Step 1 − First, we need to import the fmt and sort packages. Then create structures called Edge, graph and subset and assign properties to it. Step 2 − Then sort all the edges of the graph in non-decreasing order of their weight. Step 3 − Create a disjoint set data structure, where each set contains ... Read More

204 Views
The Depth-First Search (DFS) Algorithm is a classic Algorithm used to traverse and search graphs. In this article we are going to learn how to develop golang program where we can check if a graph is bipartie or not using DFS . Here we will use two different approaches to implement the result. Syntax func len(v Type) int The len() function is used to get the length of a any parameter. It takes one parameter as the data type variable whose length we wish to find and returns the integer value which is the length of the variable. ... Read More

510 Views
In this article we are going to understand how to use least significant bit and the most significant bit to implement radix sort. Radix sort is a sorting Algorithm that sorts elements by grouping them based on their individual digits or by the position of their digits. It is a linear time sorting Algorithm that has a time complexity of O(nk). Using the Least Significant Bit In this method, we will write a go language program to implement the radix sort by using the least significant bit. LSD sorts the elements from right to left by comparing their individual ... Read More

521 Views
In this article we are going to learn how to use recursion method and iteration to implement tower of hanoi in golang. The Tower of Hanoi is a puzzle in which we move a set of disks from one page to another by moving one disk at a time. There are certain set of rules that need to be obeyed in this puzzle. Using Recursion Approach In this method, we will write a go language program to implement tower of Hanoi by using the method of recursion. If n is 1, we can move the disk from from to ... Read More

878 Views
In this article we are going to learn how to use DFS Algorithm and breath-first searh method in golang to find all the paths in the a graph. In a graph, the nodes are depicted by the entities while the edges depict the relation between those entities. Finding all paths in a graph is a common task in graph theory and can be useful in a variety of applications. Algorithm Step 1 − First, we need to import the fmt package. Step 2 − Then create different structs and functions and define properties to them. Step 3 − Now, ... Read More