Overview The objective is to repeatedly add all digits of a number until the result is only a single digit. For example Another example Program Here is the program for the same…
Author: admin
Maximum continuous subarray sum program
Overview The objective is to find the maximum subarray in a given input array. The subarray should be contiguous and should contain at least one element For example Another example We use…
Inorder traversal of a Binary Tree
Overview In the inorder traversal of a binary tree, we follow the below order Vist Left Subtree Visit Root Visit Right Subtree For example, let’s say we have below binary tree Then…
Preorder traversal of a Binary Tree
Overview In the preorder traversal of a binary tree, we follow the below order Visit Root Vist Left Subtree Visit Right Subtree For example, let’s say we have below binary tree Then…
Postorder traversal of a Binary Tree
Overview In the postorder traversal of a binary tree, we follow the below order Vist Left Subtree Visit Right Subtree Visit Root For example, let’s say we have below binary tree Then…
Program to remove duplicates from a sorted array
Overview The objective is to remove duplicates from a sorted array. Examples Program Below is the program for the same Output
System Design of Tic Tac Toe Game
Overview Tic Tac Toe is a board game. Let’s first understand the rules of the game. In this tutorial, we will First, understand the tic tac toe game with an example See…
Interview Question: Design an Object Pool
Overview The Object Pool Design Pattern can be used to design an Object Pool. It is a creational design pattern in which a pool of objects is initialized and created beforehand and…
Add two binary numbers program
Overview The objective is to add two given binary numbers. Binary numbers are only composed of digits 0 and 1. Below is the binary addition logic for individual digits 0+0 = Sum…
Jump Game Program
Overview There is an input array provided. Each entry in the array represents the maximum jump length from that position. One is supposed to start from the first index and return true…