Overview The objective is to get the height of a binary tree. For example, if let’s say we have below binary tree Then the height of the binary tree is 3 here….
Blog
Level Order Traversal of a binary tree in Go (Golang)
Overview The objective is to print the binary tree level by level. For example, if let’s say we have below binary tree Here we have Node 1 on level 1 Node 2…
LRU Cache Implementation in Go (Golang)
Overview The objective is to implement a cache that will It should support Set and Get Operation O(1) Time Complexity for both Set and Get Assume the maximum capacity of the cache…
Check if a given tree is a Binary Search Tree in Go (Golang)
Overview We can use the below strategy to know if a given tree is a BST. For a given current node, if the left and right subtree are BST The maximum value…
Interleaving String Program in Go (Golang)
Overview Three strings are given s1, s2, s3. Find if string s3 is interleaving of string. s3 will be an interleaving of string s1 and s2 if the below condition is satisfied…
Edit Distance between two strings in Go (Golang)
Overview Given two strings find the minimum number of operations to convert one string into another. A string can be converted into another string by performing below three operations Insert Remove Replace…
Sort an array of 0, 1, and 2 in Go (Golang)
Overview The objective is to sort an array of 0,1 and 2 with all 0’s at the start, all 1’s in the middle, and all 2’s in the end. The Space Complexity…
Merge overlapping intervals in Go (Golang)
Overview Given an array of intervals where each interval has a start time and end time, merge the overlapping intervals. Two intervals are said to be overlapping if the end time of…
Group anagrams together program in Go (Golang)
Overview Given an array of strings, write a program to group all anagrams together. From Wikipedia An anagram is a word or phrase formed by rearranging the letters of a different word or phrase,…
Spiral Matrix Problem in Go (Golang)
Overview The objective is to print a matrix in a spiral format. Eg Input Output Program Below is the program for the same Output Note: Check out our Golang Advanced Tutorial. The…