Akhil Sharma has Published 671 Articles

Golang program to implement a treap

Akhil Sharma

Akhil Sharma

Updated on 05-Sep-2023 18:46:19

54 Views

In this article, we will explore the implementation of a Treap data structure in Golang using two different methods. A Treap is a combination of a binary search tree and a binary heap, making it an efficient data structure for maintaining a set of ordered elements while also ensuring balanced ... Read More

Golang program to implement a bitset

Akhil Sharma

Akhil Sharma

Updated on 05-Sep-2023 18:08:26

137 Views

A BitSet is a data structure that represents a fixed-size set of binary values, where each value can be either 0 or 1. It is commonly used for efficiently storing and manipulating large sets of boolean values. In this article, we will implement a bitset in go, using two different ... Read More

Golang program to implement a trie with compressed nodes

Akhil Sharma

Akhil Sharma

Updated on 05-Sep-2023 17:57:26

74 Views

Tries are tree-like data structures used for efficient storage and retrieval of strings, making them invaluable for tasks like autocomplete, dictionary implementation, and pattern matching. The compressed node technique optimises space usage by merging common prefixes among nodes, resulting in a more memory-efficient Trie. In this article, we will explore ... Read More

Golang program to implement a double ended priority queue

Akhil Sharma

Akhil Sharma

Updated on 05-Sep-2023 17:54:25

94 Views

A Double Ended Priority Queue, in short DEPQ is a data structure that extends the functionality of a standard priority queue. In this article, we will implement a double ended priority queue in Golang using two methods: the first method uses two separate heaps for maximum and minimum priorities, while ... Read More

Golang program to implement a hash table with linear probing

Akhil Sharma

Akhil Sharma

Updated on 05-Sep-2023 17:44:25

243 Views

Hash tables are efficient data structures used to store key-value pairs, making them essential for various applications. Linear probing is a collision resolution technique that helps handle situations when two keys map to the same index in the hash table. In this article, we will explore the implementation of a ... Read More

Golang program to implement a deque using doubly linked list

Akhil Sharma

Akhil Sharma

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

160 Views

A deque is a versatile data structure that allows insertion and deletion of elements from both ends efficiently. The doubly linked list provides an excellent foundation for building a deque as it allows easy traversal in both directions. In this article, we will explore deque using doubly linked lists in ... Read More

Golang program that takes in a list of weights and values for items and a maximum weight capacity for knapsack

Akhil Sharma

Akhil Sharma

Updated on 04-Aug-2023 16:49:37

104 Views

In this Go language article, we will write programs that take in list of weights and values for items and a maximum weight capacity for knapsack. Knapsack problem is an optimization problem that uses dynamic programming. Here, the purpose is to find out the set of items that can be ... Read More

Golang program that takes in a slice of integers and an anonymous function that filters each element in the slice

Akhil Sharma

Akhil Sharma

Updated on 04-Aug-2023 16:48:04

104 Views

In this Go language article, we will write programs that take in a slice of integers and an anonymous function that filters each element in the slice. An anonymous function is the function which uses no function name and is called by the variable which is assigned to it. It ... Read More

Golang program that takes in a slice of integers and an anonymous function that maps each element in the slice to a new value

Akhil Sharma

Akhil Sharma

Updated on 04-Aug-2023 16:47:17

56 Views

In this article, we will write Go language programs that take in a slice of integers and an anonymous function that maps each element in the slice to a new value. An anonymous function is declared without a name and is assigned to a variable which is called to execute ... Read More

Golang program to print the numbers 1 to 100 concurrently, with each number printed by a separate goroutine

Akhil Sharma

Akhil Sharma

Updated on 04-Aug-2023 16:45:59

327 Views

In this article, we will write a Go language program to print the numbers from 1 to 100 concurrently with each number printed by a separate go routine. Concurrency means execution of multiple tasks parallelly and independently and making sure all the resources of the system are utilized. It can ... Read More

Advertisements