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. In the first example, we will use an index variable to add the values in the array and in the second example we will use an append method to add the values in the array. Syntax func make ([] type, size, capacity) The make function in go language is ... Read More
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 and in the second example item struct will be used to store items. Syntax func make ([] type, size, capacity) The make function in go language is used to create an array/map it accepts the type of variable to be created, its size and capacity as arguments. Algorithm ... Read More
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 we are going to look over two different example to understand how we can use the above two techniques to check the given value in hash collection. Algorithm Create a package main and declare fmt(format package) in the program where main produces executable codes and fmt helps in formatting ... Read More
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 that will print an inverted hash collection. Syntax func make ([] type, size, capacity) The make function in go language is used to create an array/map it accepts the type of variable to be created, its size and capacity as arguments. func len(v Type) int The len() function ... Read More
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, a map is a reference type that is declared by using the map keyword, followed by the key type and value type in the format. In tis example, we will use two methods to get keys from a hash collection, in the first example we will use append method to ... Read More
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 add items to a hash collection in go programming language. Syntax func make ([] type, size, capacity) The make function in go language is used to create an array/map it accepts the type of variable to be created, its size and capacity as arguments. Algorithm Import the required ... Read More
Introduction Amazon Web Services (AWS) is one of most popular cloud computing platforms in world. It provides a wide range of services, such as storage, computing, networking, and databases, to name a few. AWS Command Line Interface (CLI) is a powerful tool that allows you to manage your AWS resources using commands in terminal or shell. In this article, we will discuss how to install AWS CLI on Linux, including various sub-headings and examples. Step 1: Check Python Installation Before installing AWS CLI, you need to ensure that Python is installed on your Linux system. Python is a programming ... Read More
Introduction The Unix operating system is known for its powerful command-line interface and an extensive collection of tools. Among these tools, "uniq" command is a popular utility that is used to filter out duplicate lines in text files. This command is often used in conjunction with other command-line tools and shell scripts to manipulate data and automate tasks. In this article, we will explore "uniq" command in detail, including its syntax, options, and examples of its usage. Syntax The syntax of "uniq" command is simple and easy to understand. basic syntax of command is as follows − uniq [options] [input_file] ... Read More
Introduction Awk is a powerful text processing tool that is widely used by developers, system administrators, and analysts to manipulate data in a variety of ways. It is a versatile tool that can process text files, extract data, and transform it into a variety of formats. One of key features of Awk is its ability to process multiple input files at same time, making it ideal for batch processing tasks. In this article, we will explore how to use Awk to process multiple input files and examine several examples of how it can be used in practice. Using Awk with ... Read More
Introduction When working with Linux or any command-line interface, you may come across situations where you need to combine multiple lines of text into a single line. This can be helpful for formatting or readability purposes, and it can also be necessary for certain scripting tasks. In this article, we will discuss several methods for joining multiple lines into one on Linux, including use of command-line tools like sed, awk, and paste. We will provide examples of each method to demonstrate how they can be used in different situations. Method 1: Using "tr" Command One of simplest ways to join ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP