Akhil Sharma has Published 671 Articles

Golang Program to Iterate Map Elements using the Range

Akhil Sharma

Akhil Sharma

Updated on 07-Sep-2023 17:15:48

168 Views

Maps in Golang provide a convenient way to store and access the given data in format of key−value pairs. Iterating over a map allows us to process each key−value pair and perform operations on them. In this article, we will explore different methods to iterate map elements using the range, ... Read More

Golang Program to Create a Copy of the Map

Akhil Sharma

Akhil Sharma

Updated on 07-Sep-2023 17:12:53

170 Views

Maps are reference data types in Golang, which means that assigning one map variable to another creates a reference to the same underlying data structure. To create an independent copy of a map, we need to use different methods. In this article, we will explore two methods that include the ... Read More

Golang Program to Delete items of Map

Akhil Sharma

Akhil Sharma

Updated on 07-Sep-2023 17:11:09

1K+ Views

Maps in Go provide a convenient way to store and access data in form of key−value pairs. Deleting items from a map is a common operation when working with dynamic data. In this article, we will delete items of map in golanguage using three methods: the delete() function and iterating ... Read More

Golang Program to Create a Simple Map

Akhil Sharma

Akhil Sharma

Updated on 07-Sep-2023 17:08:37

84 Views

Maps in Go are powerful data structures that allow us to store and retrieve key−value pairs. They are useful for various applications, such as storing and manipulating data, implementing dictionaries, and performing efficient lookups. In this article, we will write a program to create a simple map in golanguage using ... Read More

Golang Program to Perform Slices Permutations of Numbers Entered by the User

Akhil Sharma

Akhil Sharma

Updated on 07-Sep-2023 17:05:12

128 Views

A slice is a portion of data extracted from an array, list or a data structure. Permutations refer to the rearrangement of elements in a specific order.Here slice permutation means to generate all the possible permutations of the number entered by user. In this article, we will explore how to ... Read More

Golang Program to Print all Permutations of a given String

Akhil Sharma

Akhil Sharma

Updated on 07-Sep-2023 16:54:50

389 Views

A permutation is an arrangement of the characters of a string in a specific order. In some cases we need to print all the permutations of a string to create anagram games or puzzle games where users need to find out the letters hidden in the string. In this article ... Read More

Golang Program to Print a Matrix in Spiral Format

Akhil Sharma

Akhil Sharma

Updated on 07-Sep-2023 16:52:06

119 Views

To Print a matrix in spiral format we need to traverse the matrix in a spiral pattern, starting from the outermost layer and gradually moving inward. This approach provides a visually appealing way to display matrix elements. In this article we will use two methods to print a matrix in ... Read More

Golang Program to Implement Median of Medians

Akhil Sharma

Akhil Sharma

Updated on 07-Sep-2023 16:49:04

137 Views

The median is the element in the middle of a dataset when the dataset is sorted. The Median of Medians algorithm is a powerful technique that is used to find out the median element in an unsorted array. In this article, we will implement median of medians algorithm in golanguage, ... Read More

Golang Program to Implement Rabin Karp

Akhil Sharma

Akhil Sharma

Updated on 07-Sep-2023 16:47:10

80 Views

The Rabin−Karp algorithm in Golang is a powerful string searching algorithm used to efficiently locate a pattern within a larger text. In this article, we need to implement Rabin Karp algorithm in golanguage that will enable efficient pattern matching and showcasing the flexibility of this algorithm in Golang. We can ... Read More

Golang program to implement a weighted interval scheduling algorithm

Akhil Sharma

Akhil Sharma

Updated on 05-Sep-2023 19:03:01

94 Views

The Weighted Interval Scheduling Problem revolves around a set of intervals, each having an associated weight. In this article, we will implement the Weighted Interval Scheduling algorithm in go, using two methods: Recursive and Dynamic Programming. This classic optimization problem involves selecting non-overlapping intervals with maximum total weight. ... Read More

Advertisements