Aman Sharma has Published 69 Articles

Golang Program to Implement Kaden's Algorithm

Aman Sharma

Aman Sharma

Updated on 10-Jul-2023 17:34:03

87 Views

There is a famous maximum sum subarray problem, in which we have a 1 Dimensional array and must find the maximum sum in that subarray. To solve this problem, the most naive approach will be to find all the sub − arrays, sum their elements, and return the maximum, but ... Read More

Golang Program to Implement Binary Search Algorithm

Aman Sharma

Aman Sharma

Updated on 10-Jul-2023 17:26:38

182 Views

In programming, to search for anything from an array, linked List, or any other data structures we have a few search algorithms, one of which is binary search. In binary search, the prerequisite is that the data should be sorted. In binary search, we follow the divide and conquer approach ... Read More

Golang program to find the union of two arrays

Aman Sharma

Aman Sharma

Updated on 10-Jul-2023 17:24:56

280 Views

In Golang, like other programming languages, we can find the union of two arrays. The union of two arrays is a list that consists of elements that lie in array A and the elements that lie in array B and common elements that lie in both arrays. For example, we ... Read More

Golang Program to Find Max No. of 1 in a Sorted Row of the Matrix

Aman Sharma

Aman Sharma

Updated on 10-Jul-2023 17:23:48

49 Views

In programming languages, we can create 2−Dimensional Matrices and store elements in them. The 2−Dimensional metric is a data structure that has rows and columns. In this article, we are going to see the two different logic to find the maximum no. of ones in a sorted row of the ... Read More

Golang program to find duplicates in N+1 array

Aman Sharma

Aman Sharma

Updated on 10-Jul-2023 17:22:26

398 Views

In programming, there is a problem statement asked in interviews to find the duplicate number in an array of size N + 1. Also, there will be only one duplicate element in the array. The elements will be between 1 to N. For example, Array = {1, 3, 2, 1, ... Read More

Golang Program Level Order Traversal of Binary Tree

Aman Sharma

Aman Sharma

Updated on 10-Jul-2023 17:20:06

192 Views

In programming, there are different data structures to store data. There are two different types of data structures linear and non −linear. Array, stack, queue, and linked list are linear data structures. Binary trees, trie, etc are non − linear data structures. In this article, we are going to ... Read More

Golang Program Left View of Binary Tree

Aman Sharma

Aman Sharma

Updated on 10-Jul-2023 17:17:31

89 Views

In programming, there is a coding problem of binary tree that gets asked very frequently in interviews and the problem statement is to find the left view of a binary tree. If we try to understand the problem statement more than what exactly the left view is then we ... Read More

Golang program Breadth-First Search graph

Aman Sharma

Aman Sharma

Updated on 10-Jul-2023 17:15:46

597 Views

Graph is a data structure that consists of edges or we can say nodes and vertices. Vertices are the lines between the nodes. To traverse all these nodes we have different traversal algorithms. In this article, we will discuss, Breadth − first search or we can say BFS. In Breadth ... Read More

How to return an array to the function in Golang?

Aman Sharma

Aman Sharma

Updated on 10-Jul-2023 17:13:28

2K+ Views

In programming, to make the code more modular, usable, and readable we break the code into different functions. For example, we have to swap two numbers at different places so instead of swapping in place we create a different function and call it everywhere. In some use cases, we need ... Read More

How to Return a String from the Function in Golang?

Aman Sharma

Aman Sharma

Updated on 10-Jul-2023 17:10:56

1K+ Views

In programming, to make the code more modular, usable, and readable we break the code into different small blocks and these blocks are known as functions. A string is a data structure consisting of a set of alphabets. In solving any programming problem we want that the function should return ... Read More

1 2 3 4 5 ... 7 Next
Advertisements