A binary tree is a data structure where every node has at most two child nodes. Below is a sample binary tree. The top most node is the root node.

All nodes at the bottom that do not have any child nodes attached are known as leaf nodes.

A simple binary tree

If a binary tree is of height h, then there can be maximum 2⁽ ʰ⁺ ¹⁾-1 nodes. Let n be the number of nodes. …


We are at the end of another year. As we say good bye to this year with teary eyes and runny noses, we are overjoyed to welcome the new year. Though we may wish each other HAPPY NEW YEAR , we have our own doubts as to how happy it is going to be. When we reflect on this year's experience, it has been nothing short of a Hollywood movie where a virus leaks and everything goes downhill.

Having said that I think not everything was bad this year. When our freedom was taken away and we were forced to…


Last article I wrote about insertion in singly linked list and displaying its contents. Today I thought to extend that article (also I was sitting idly). We will try to delete the last node.

This can be done by
1) Traversing to the last node.

Traversing

2) Delete the node.


Hi folks. Past few months I have been trying out golang and it is quite fun learning. I am sharing a code snippet implementing linked list.

As we all know linked list is a data structure which contains value and pointer to the next value (or location to the next value). Linked list can grow dynamically, as long you do not run out of heap space. Diagrammatically a linked list looks something like this:

My pretty linked list

Now let us see how we can implement this simple singly linked list in golang, where we are going to insert new values as well print…

Sandeep Sarkar

Backend Developer, System Engineer, DevOps, Cloud Native Engineering, Hybrid Cloud 🇮🇳

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store