Problems on Binary Tree Checking if a Binary Tree is foldable A binary tree is foldable if the left subtree and right subtree are mirror images of each other. An empty tree is also foldable. We have presented two algorithms to check if Binary Tree is foldable.
Problems on Binary Tree Serialization and Deserialization of Binary Tree We have presented the process of Serialization and Deserialization of Binary Tree where we convert a Binary Tree into a compress form which can be saved in a file and retrieved back.
Problems on Binary Tree Convert a Binary Tree to a Skewed Binary Tree We have presented the algorithm to Change a Binary Tree to a Skewed Binary Tree (both Increasing Skewed Binary Tree and Decreasing Skewed Binary Tree).
Problems on Binary Tree Check if a Binary Tree is skewed or not We have presented the algorithm to check if a given Binary Tree is skewed or not (can be left or right skewed Binary Tree).
Algorithms Munchausen Number A number that is equal to the sum of its digits each raised to the power equal to its digit is a Munchausen Number or perfect digit-to-digit invariant(PDDI).
Problems on Binary Tree Find ancestors of a given node in a binary tree (Recursive + Iterative) Understand how to find ancestors of a given node in a binary tree recursively and iteratively in linear time O(N).
Problems on Binary Tree Find nodes which are at a distance k from root in a Binary Tree We are given the root of a tree, and an integer k. We need to print all the nodes which are a distance k from the root.
Problems on Binary Tree Find ancestors of a node in Binary tree (Recursive) In this problem, we are given a binary tree and a key k. We need to find out all the ancestors of node k. We have used a recursive approach.
Machine Learning (ML) SAME and VALID padding SAME and VALID padding are two common types of padding using in CNN (Convolution Neural Network) models. SAME padding is equal to kernel size while VALID padding is equal to 0.
Algorithms Finding nodes at distance K from a given node We have discussed the approach to find out the nodes at k distance from the given node. There are two approaches: one using Breadth First Traversal and other using Percolate Distance.
Problems on Binary Tree Check if a Binary Tree has duplicate values Given a Binary Tree, we will develop an algorithm to check if it has duplicate values. This can be done in linear time O(N) where there are N elements in the Binary Tree.
Algorithms 3 Sum problem (Triplets with given Sum) Given an array, we need to find if there is a triplet in the array whose sum is equal to a given value. If such a triplet is present, we need to print it and return true. Else, return false.
Algorithms Counting derangements Given any integer N, we need to find out the number of Derangements for a set of N elements.
Machine Learning (ML) How a ML Dataset is designed? In this article, we have explored How a (Machine Learning) ML Dataset is designed? with the example of the PASCAL dataset (Pascal-1 Visual Object Classes (VOC)) and how it evolved over the years and how the initial dataset was prepared.
Software Engineering footer tag in HTML The "footer" tag is normally used for defining the footer or end part of a section on html page. Each "footer" will have information about its containing element. The "footer" will have information about the article and the page author.
Software Engineering Defining 2D array in Python We have explored the different ways of defining a 2D array in Python. We have explored three approaches: Creating a List of Arrays, Creating a List of Lists and creating 2D array using numpy.
Algorithms Applications of Linked list We have covered the applications of Linked List, Circular Linked List and Doubly Linked List. We start with the basics of Linked List and then, move to applications of the different types of Linked List.
Algorithms What is a Disarium Number? A disarium number is a number in which the sum of the digits to the power of their respective position is equal to the number itself (position is counted from left to right starting from 1).
Algorithms Assembly Line Scheduling using Dynamic Programming The main goal of solving the Assembly Line Scheduling problem is to determine which stations to choose from line 1 and which to choose from line 2 in order to minimize assembly time. We solve this using Dynamic Programming.
Algorithms Commonly asked interview questions on sorting algorithms. Power booster for your interview preparation! In this article, we have presented several multiple choice questions (MCQs) on Sorting Algorithms for coding interviews with answers. This will help you get prepared.
Algorithms Dice Throw Problem (Dynamic Programming) There are d dice each having f faces. We need to find the number of ways in which we can get sum s from the faces when the dice are rolled. We have explored a Dynamic Programming solution to Dice Throw problem.
Problems on Binary Tree Find if a given Binary Tree is a Sub-Tree of another Binary Tree A sub-tree is a tree itself that is the subset of a bigger binary tree. A subtree of a node means that it is the child of that node. In this article, we will find out different ways to find out if a given binary tree is a sub-tree of another binary tree.
Problems on Binary Tree Convert Binary Tree to Threaded Binary Tree We will focus on different approaches on how to convert a normal binary tree into a threaded binary tree. We will convert our binary tree to single threaded binary tree with right pointers pointing to inorder successor (if it exists).
Algorithms Maximum Sum Decreasing Subsequence (Dynamic Programming) Given an array of n positive integers, find the sum of the maximum sum decreasing subsequence (msds) of the given array such that the integers in the subsequence are sorted in decreasing order.
Problems on Binary Tree Check if a Binary Tree is Balanced by Height In this article, we have explored the algorithm to check if a Binary Tree is balanced by height or not.