Exploring Tree-Inorder Traversal

In last post Introduction to tree data structures, I have give a brief introduction about tree data structure and its applications. Traversing a tree data structure is interesting as well as complicated as compare to linear data structures. Unlike arrays or linked list which are traversed in linear order, tree…

Introduction to Tree data structures

In the realm of data structures, Linked list, array can be described as a linear data structure unlike trees which are non-linear, hierarchical data structures.

A tree can be defined as a collection of nodes in which node stores a value and a list referencing to children nodes. …

Given the `head` of a singly linked list, reverse the list, and return the reversed list.

A easy category linked list problem where we need to reverse the Linked list.For this there are two method-iterative and recurrssive method.Here we will apply the iterative method. For this method we will need…

The “Hello world” of Data Structure-Linked List.

Linked is type of linear data structure which is widely use to solve specific problem raise due to the limitation of arrays.
Linked list can be define as linear data structure in which the elements are not stored in contiguous memory location. …

Beautiful Triplets

Problem statement:-

Solution:-
A very straight forward hackerrank problem where we have to find the count of triplet form based on condition given in the problem statement.

Halloween Sale

Problem:-

Solution:-
A
straight forward hackerrank problem where we have to calculate the number of gifts one can buy with given amount.

Minimum Distances

Problem:-The distance between two array values is the number of indices between them. Given a, find the minimum distance between any pair of equal elements in the array. If no such value exists, return -1.

Repeated String

Problem Statement:-
There is a string ”s”, of lowercase English letters that is repeated infinitely many times. Given an integer ,”n”. Find and print the number of letter “a” in string “s” in the first “ n” letters of the infinite string.

Solution:-
Interesting hackerrank problem where we need to find…

Taum and B’day

Problem Statement:-

Solution:-
A very simple one line solution to this problem. Here we are trying to find out the minimum cost at which we can buy both white and black gifts.

Jumping on the Clouds

Problem statement:-

Solution:-Simple but not so straight forward hackerrank problem where we have to count the number of jumps based on which type of cloud is allowed to jump on it or not in that case the jump range will increase.

Parag Naik

Work in progress

Get the Medium app