- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- 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 1082 Articles for Go Programming
89 Views
In this article, we will write Go language programs to find the minimum no. of edges in a weighted directed graph that connects all nodes. We will use Prim’s algorithm to perform this operation. It is a greedy algorithm which is used to find the minimum spanning tree for a graph. Syntax func range(variable) Any data type may be iterated over using the range function. This may be used by first writing the range keyword, then the data type to which we wish to iterate func make ([] type, size, capacity) The go language's make function is used ... Read More
100 Views
Bellman-ford algorithm is used to find the shortest distance from the source node to the other nodes in a weighted directed graph. This algorithm also predicts the negative weight cycles in the graph. It has a time complexity of O(V*E) where V stands for vertices and E stands for edges.In this Golang article, we will write programs to find the shortest path from source node to a target node using the Bellman-ford algorithm. Syntax func range(variable) The range function iterates through any data type. To utilise this, first type the range keyword followed by the data type to which ... Read More
225 Views
In this article, we will write Go language programs to implement radix sort for sorting floating-point numbers. Radix sort is usually used for sorting the integers, it can also be used to sort floating point numbers. It sorts items based on their particular bits or digits. This article provides an effective approach to sort the floating point numbers using the representation of floating point numbers. Algorithm Step 1 − Convert the floating-point numbers to a sortable format Step 2 − Perform a Radix Sort for each digit position Step 3 − Sort the integers based on the current ... Read More
123 Views
Radix sort is efficient for sorting strings because of its inherent structure of string data type.In this article, we will write a Go language program to implement radix sort for sorting strings. We start working on an unsorted array string and demonstrate how radix sort can be applied to sort it. A string is a character array or combination of characters. Syntax func make ([] type, size, capacity) The make function in Go is used to build an array/map. It receives as arguments the kind of variable to be generated, as well as its size and capacity. func range(variable) ... Read More
65 Views
A subroutine is a part of a program which performs a specific task and can be called repeatedly based on the purpose and use. When a subroutine is called, the program shifts to that routine and executes the instructions inside that routine.Radix sort is an algorithm that sorts elements from their digits. It has a linear time complexity and is used for sorting large amounts of data. It uses counting sort to calculate the frequencies of digits.In this Golang article, we will write programs to implement radix sort using bucket sort as a subroutine. Syntax func len(v Type) int ... Read More
103 Views
Radix sort is an algorithm that sorts elements from their digits. It has a linear time complexity and is used for sorting large amounts of data. It uses counting sort to calculate the frequencies of digits. Counting Sort is an algorithm that is efficient in sorting when the input is integer within a particular range. It counts the occurrence of each unique element from the input and uses that information to get the correct position of each element. A subroutine is a function of the program which performs a specific task and can be used when and repeatedly called in ... Read More
49 Views
A red black tree is a self balancing binary search tree. Rotation is one of the fundamental operations of a self balancing tree. It is performed to maintain the tree's properties while inserting and deleting nodes to the tree. In this article we are going to write a language program to perform left rotation in a Red Black tree using pointers as well as using node value. Properties of Red Black tree Every node is either red or black The root node is always black Every leaf node is considered black If a node is red, both its children ... Read More
55 Views
There can be some situations in which you have a list of employees and you need to find out the bonus paid to a particular employee. Go language allows you to perform the task easily, in this article we are going to find out the total bonus paid to a particular employee using a fixed bonus amount as well as calculating individual bonus percentage. Algorithm Create a struct Employee with the attributes Name and BonusPercent. Calculate the total bonus using the function calculateTotalBonus, float64: Set the variable totalBonus to 0.0. Iterate through the employees array, one ... Read More
45 Views
In corporate office there may be some cases in which you have a list of employees and you need to provide them extra bonus based on the work or experience or a particular property. In this article we are going to explore a way to calculate bonus using performance based calculations and tenure based calculations. Method 1: Performance Based Calculations Performance is the common base to determine the employee’s bonus, in this method we are going to calculate the bonus depending on the performance of the employee. Algorithm Create the Employee struct, which has the values Name, Salary, and ... Read More
87 Views
There may be scenarios in which you need a list of employees and you need to display them in a particular order based on their name initials. In this Golang article, we are going to sort employee names using bubble sort, insertion sort as well as using go sort package. Algorithm Create a field called “Name” in the Employee struct. Use the array of Employee objects as input for the “BubbleSortByEmployeeName” method. Obtain the employees array's length and save it in the variable n. Start the outer loop from i = 0 to n-1 and Start the ... Read More
To Continue Learning Please Login
Login with Google