Articles for author: Sai Srikanth Murki

Check for BST

Problem Statement Given a binary tree, we have to determine if the tree is a binary search tree or not.A tree is said to be a valid binary search tree when, Example consider the following examplesexample-1 output: example-2 output: Example Explanation In example 1,Condition 1 is not satisfied. All the nodes in the left subtree ...

Coin Change Problem

Introduction to Coin Change Problem The “coin change problem” expects a solution to find the minimum number of specific denomination coins required to sum up to a given value. This problem can be categorized as a variation of the “knapsack problem”, and the solution can be optimized using the Dynamic Programming approach. So let’s get ...

Serialize and Deserialize a Binary Tree

The need for data structures also demands the ability to convert them into a storable format and reconstruct back later. Serialization is the process of converting a data structure into a sequence of bits. And deserialization is the process of reconstructing the data structure from the serialized sequence. Introduction Data structures play a crucial role in designing efficient software, and ...