
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

324 Views
Java is a popular programming language used by many people around the world. It has been an object-oriented programming language for more than 20 years, and its use has only increased. Whether you are currently familiar with Java or are interested in studying it, you may be asking how you might improve your proficiency with it. We'll provide you some pointers and advice in this article that will enable you to master Java. Paths Using an organised approach to learning is one of the greatest ways to develop your Java skills. You can learn Java in a variety of ... Read More

2K+ Views
In this Golang article, we will explore how to implement Dijkstra's Algorithm to find the shortest path between two nodes in a graph using an Adjacency Matrix as well as using an Adjacency List. Dijkstra's Algorithm is used to solve the single-source shortest path problem in a graph with non-negative edge weights. Algorithm Step 1 − First, we need to import the fmt and math packages. Then create a dist array of length n (the number of nodes in the graph) and initialize it with math.MaxInt32. This array will store the shortest distance from the starting node to every ... Read More

1K+ Views
In this Golang article, we will learn how to implement Merge Sort in Golang using three different methods recursions, iteration and goroutines. Merge sort is one of the most efficient sorting Algorithms that uses the divide and conquer approach to sort a list of elements. Syntax func copy(dst, str[] type) int The copy function in go language is used to copy the values of one source array to the destination array and returns the number of elements copied as the result. It takes the two arrays as an argument. func len(v Type) int The len() function is used ... Read More
Golang program to find shortest path between all pairs of nodes in a graph using dijikstra Algorithm

614 Views
In this golang program article, we are going to learn how to use a struct Edge to represent a weighted edge in the graph, and the dijkstra function takes the number of nodes n and a slice of Edge objects as input. It returns a two-dimensional slice representing the distance matrix between all pairs of nodes in the graph In this Golang article, we will explore how to implement Dijkstra's Algorithm in to find the shortest path between all pairs of nodes in a graph. Algorithm Step 1 − First, we need to import the fmt and math packages. ... Read More

183 Views
In this Golang article, w will understand how to use interval scheduling Algorithm find the minimum number of resources needed to complete all the tasks simultaneously. Interval scheduling Algorithm is a type of Algorithm used to solve scheduling problems where a set of tasks with start and end times must be scheduled on a limited resource. Algorithm Step 1 − First, we need to import the fmt and Sort packages. Then initialize the required structs along with the functions. Step 2 − The task struct is used to track the start and end time of the task whereas ... Read More

120 Views
In this Golang article we are going to find the maximum number of classes that can be scheduled without conflicts, if there is a list of intervals representing classes. Here we are going to slice function to perform this task. Following Algorithm will help you understand the steps taken to creat the golang program. Algorithm Step 1 − First, we need to import the fmt and sort packages. Step 2 − Then, create a struct named interval and store in it the start and end variable. Step 3 − Now, start the main() function. Inside the main() Initialize the ... Read More

587 Views
In this article we will write a go language program to find minimum spanning of tree. A minimum spanning tree (MST) is a tree that connects all the nodes in an undirected, weighted graph with the minimum possible edges. There are several Algorithms to find the minimum spanning tree of a graph like dijkastra Algorithm, prim's Algorithm and kruskal's Algorithm. What is Dijkistra Algorithm? Dijkstra's Algorithm is an Algorithm that finds the shortest path between a source vertex and all other vertices in a weighted graph with non-negative edge weights. It works by maintaining a set of visited vertices ... Read More

252 Views
In this article, we will learn how to write a golang program to find the last occurrence of a target element in a sorted slice using linear and binary search approach. We will use two programs in this article. In the first program we will use the Linear search approach while in the second one we will use the binary search approach to implement the result. Using the Linear Search Approach The simplest method to find the last occurrence of a target element in a sorted slice is to perform a linear search. In this method, we iterate through the ... Read More

329 Views
In this article we will write a go language program to find the diameter of a graph. The diameter of a graph is the maximum distance between any two vertices in the graph. There are several Algorithms that can be used to find the diameter of a graph, including Dijkstra's Algorithm, Floyd-Warshall Algorithm, and Breadth-First Search Algorithm. Since, dijkastra Algorithm finds the shortest distance between source vertex and other vertices. We can also use it to find the largest distance by comparing the length of vertices recieved. Syntax func len(v Type) int The len() function is used to get ... Read More

310 Views
In this golang article we are going to find the minimum number of coins needed to make a given amount of money if a list of coins with different denominations is given. We can use the Greedy Algorithm for this problem. Algorithm Step 1 − First, we need to import the fmt package. Step 2 − Then create a function named minCoins() used to calculate the minimum number of coins. The function accepts two arguments one is the array of integers having number of coins and the amount that is to be formed. Step 3 − Inside this function ... Read More