Overview int is a signed Integer data type uint is an unsigned Integer data type Size and range of int and uint in go is platform-dependent meaning that the size and range…
Tag: go
Insertion Sort in Go (Golang)
Introduction Insertion Sort is one of the simplest sorting algorithms. In insertion sort, the input array is broken down into two parts Sorted Unsorted Initially sorted part only contains the first element…
Sort a Custom Struct in Go (Golang)
Introduction GO has a sort package that provides utility primitives for the sorting of slices and user-defined types. Any collection can be sorted by the Sort function of sort package of GO…
HeapSort in Golang
Introduction HeapSort is a comparison-based sorting algorithm that uses the Heap Data Structure. Please refer to this link for more information about Heap –https://golangbyexample.com/heap-in-golang/ We demonstrate the heapsort in this article using…
MaxHeap in Golang
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…
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…
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 –…