Introduction A MaxHeap is a complete binary tree in which the value of the parent node is greater than or equal to the value of its left and right child. A complete…
Author: admin
MinHeap in Golang
Introduction A MinHeap is a complete binary tree in which the value of the parent node is less than or equal to the value of its left and right child. A complete…
Linked List in Golang
Singly-linked list is a simple kind of linked list that allows traversal in one direction i.e forward. Each node in the linked list contains the data part and the pointer to the…
How to Pause a Go Program until enter key is pressed
Sometimes there is a need to pause a go program until a key is pressed. Eg. One would only want a go program to exit at the end only on the press…
Empty struct in GO
Empty struct struct{} in GO doesn’t occupy any memory. It is of zero byte. Below are some of the uses of empty struct Useful for creating implementations that require no data. Eg….
Set implementation in Golang
A set is a data structure that holds elements without any particular order. An element only appears once in a set. Set can be implemented in GO using a map. We will…
Inner working of Channels in Golang
Introduction The purpose of this article is to give an idea of the inner working of channels. Golang has two concurrency primitives: Goroutine – lightweight independent execution to achieve concurrency/parallelism. Channels – provides synchronization…
Go : Check if type implements an interface
Sometimes there can be scenarios where it is needed to know if your type satisfies an interface or not. This can be easily achieved using a blank identifier. In the above program,…
Find the type of an object in Go (Golang)
This article will describe different ways of knowing the type of an object in Go Using Reflect Package Reflect package provides some useful inspect functions that let us know the type Output:…
Function/Method Overloading in Golang (Alternatives/Workaround)
Function/Method Overloading means that that the same function/method name can be used with a different number and types of parameters See this post for difference between function and method in Go –…