Akhil Sharma has Published 671 Articles

Golang program to check a given key exists in the hash collection or not

Akhil Sharma

Akhil Sharma

Updated on 27-Mar-2023 10:11:48

88 Views

In Golang we have inbuild function like ok idiom to check whether a given key exist in hash collection or not. Hashmap is a collection of values paired with key in hashmap collection. In this article, we will create a hashmap using the built-in function then we will use ok ... Read More

Golang program to merge two hash collections

Akhil Sharma

Akhil Sharma

Updated on 27-Mar-2023 10:11:11

271 Views

In golang we can merge two hash collection by using map function. A hashmap is present in hash collections. It stores key:value pairs. We can perform various operations on a hashmap like merging them. In this article we will merge two hashmaps using a method. In that method, we ... Read More

Golang program to convert the hash collection into the array

Akhil Sharma

Akhil Sharma

Updated on 27-Mar-2023 10:09:59

136 Views

In Go programming language, a hash collection contains a hashmap which holds values in form of key:value pairs. Here, in this particular program we will convert the map into array which is of fixed size and can be accessed via indexing. We will use two examples to execute the program. ... Read More

Golang program to store items into the hash collection

Akhil Sharma

Akhil Sharma

Updated on 27-Mar-2023 10:08:52

1K+ Views

In Golang, a Hashmap is a part of hash collection and it stores values in the form of key:value pairs. In this articlewe will store items in the hash collection using two different examples. In the very first example the indexing will be used to store items in the map ... Read More

Golang program to check a value exists in the hash collection or not

Akhil Sharma

Akhil Sharma

Updated on 27-Mar-2023 10:06:02

587 Views

In golang we can check whether a given value exist in hash collection or not by simply using okidiom function or we can even create an if-else user-defined function to do the same. Hashmap is basically a collection of values paired with their keys in hash collection. In this article ... Read More

Golang program to print the inverted hash collection

Akhil Sharma

Akhil Sharma

Updated on 27-Mar-2023 10:04:55

111 Views

In golang, we can print the inverted hash collection using the inverted mapping method. Hashmap stored the data in pair of key:Value in hash collection and that reduces the execution time. In this article we are going to see two different example to understand how to create a golang program ... Read More

Golang program to get keys from a hash collection

Akhil Sharma

Akhil Sharma

Updated on 27-Mar-2023 09:57:59

378 Views

A hash collection is a data structure that contains key-value pairs in Go and enables quick lookups, additions, and deletions. The value that corresponds to the key can be accessed by hashing the key into an index. Hash collections in the form of maps have built-in support in Go. Here, ... Read More

Golang program to add items into the hash collection

Akhil Sharma

Akhil Sharma

Updated on 27-Mar-2023 09:52:12

142 Views

In Golang, we can use a simple indexing method and slicing method to add items to the hash collections. A hash function is used for retrieving and storing the data. In this article are going to see two different examples where we are going to use the above-mentioned methods to ... Read More

Haskell Program to compare numbers and strings using library function

Akhil Sharma

Akhil Sharma

Updated on 13-Mar-2023 15:41:02

786 Views

In Haskell, we will compare numbers and strings using library function using compare, min and max functions. Also, by using Eq and Ord typeclasses. In the first example we are going to use (compare num1 num2 and compare str1 str2) function and in the second example, we are going ... Read More

Haskell Program to Display Prime Numbers Between Two Intervals

Akhil Sharma

Akhil Sharma

Updated on 13-Mar-2023 15:27:44

189 Views

In Haskell, we can display Prime Numbers between Two Intervals using user-defined functions and list comprehension. In the first example, we are going to use (isPrime and primesInRange) user-defined functions and in the second example, we are going to use list comprehension. Algorithm Step 1 − The Data.List library ... Read More

Advertisements