Akhil Sharma has Published 507 Articles

Golang program to create a hash collection

Akhil Sharma

Akhil Sharma

Updated on 03-Apr-2023 13:18:29

272 Views

In this article, we will write a Golang programs to create hash collections with the help of make function and map function. Hashmap stores key value pairs that can be accessed via index. In this program we will create a hash collection with the help of two examples. Syntax func ... Read More

Golang program to demonstrate a simple module

Akhil Sharma

Akhil Sharma

Updated on 03-Apr-2023 13:17:34

255 Views

In this Go language article, we will write programs to demonstrate a simple module. A module in Go is called as the collection of packages namely we can call it packages and sub-packages where the root file will be called as go.mod. In this program we will demonstrate a module ... Read More

Golang program to perform binary search on a slice of custom structs

Akhil Sharma

Akhil Sharma

Updated on 03-Apr-2023 13:14:13

1K+ Views

In this Golang article, we are going to perform binary search on a slice of custom structs using iterative and recursive method. Binary search is a search algorithm used to find the position of a specific value within a sorted sequence of elements. Algorithm Step 1 − First, we ... Read More

Golang program to check if a stack is empty

Akhil Sharma

Akhil Sharma

Updated on 03-Apr-2023 13:13:45

343 Views

In this Golang article, we are going to check if a stack is empty using iterative and recursive method. A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle. Algorithm Step 1 − First, we need to import the fmt and strconv package. Step 2 − ... Read More

Golang program to reverse a stack

Akhil Sharma

Akhil Sharma

Updated on 03-Apr-2023 13:13:14

305 Views

In this Golang article, we are going to reverse a stack using recursive and iterative method. A stack is a linear data structure that follows the Last-In-First-Out (LIFO) principle. Algorithm Step 1 − First, we need to import the fmt and strconv package. Step 2 − Create a stack ... Read More

Golang program to find if there exists a pair of numbers in an array that add up to a given target sum using two pointer approach

Akhil Sharma

Akhil Sharma

Updated on 03-Apr-2023 13:12:40

649 Views

In this Golang article, we are going to find if there exists a pair of numbers in an array that add up to a given target sum using two pointer approach with iterative and optimized-iterative method. An array is a collection of elements of the same data type, arranged in ... Read More

Golang program to find longest subarray with a given sum using two-pointer approach

Akhil Sharma

Akhil Sharma

Updated on 03-Apr-2023 13:12:02

377 Views

In this Golang article, we are going to find longest subarray with a given sum using two-pointer approach with iterative and optimized-iterative method. An array is a collection of elements of the same data type, arranged in a contiguous block of memory, and accessed using an index or a subscript. ... Read More

Golang program to remove duplicates from a sorted array using two-pointer approach

Akhil Sharma

Akhil Sharma

Updated on 03-Apr-2023 13:11:30

891 Views

In this Golang article, we are going to remove duplicates from a sorted array using two-pointer approach with iterative and optimized-iterative method. An array is a collection of elements of the same data type, arranged in a contiguous block of memory, and accessed using an index or a subscript. A ... Read More

Golang program to find the maximum product of two numbers in an array using two pointer approach

Akhil Sharma

Akhil Sharma

Updated on 03-Apr-2023 13:10:58

553 Views

In this Golang article, we are going to find the maximum product of two numbers in an array using two pointer approach with iterative and optimized-iterative method. An array is a collection of elements of the same data type, arranged in a contiguous block of memory, and accessed using an ... Read More

Golang program to find if a given subarray exists in a given array using two pointer approach

Akhil Sharma

Akhil Sharma

Updated on 03-Apr-2023 13:10:09

552 Views

In this Golang article, we are going to find if a given subarray exists in a given array using two pointer approach with iterative and optimized-iterative method. An array is a collection of elements of the same data type, arranged in a contiguous block of memory, and accessed using an ... Read More

Advertisements