Sunidhi Bansal has Published 1100 Articles

Container with Most Water in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 10:06:57

140 Views

We are given an array of height of the walls of the container. The goal is to find the container that can contain the maximum volume of water. As heights of walls are elements of an array, the distance between them is considered as width between two walls. For example ... Read More

Maximum length cycle that can be formed by joining two nodes of a binary tree in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 10:03:43

179 Views

We are given a binary tree. The goal is to find the maximum length cycle in the given tree. We will do this by finding the maximum height of the left subtree and right subtree from the root node and will join these maximum length paths to get the longest ... Read More

Construct Tree from given Inorder and Preorder traversals in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 09:58:45

776 Views

We are given the Inorder and Preorder traversals of a binary tree. The goal is to construct a tree from given traversals.Inorder traversal − In this type of tree traversal, a left subtree is visited first, followed by the node and right subtree in the end.Inorder (tree root)Traverse left subtree ... Read More

Continuous Tree in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 09:53:38

143 Views

A Continuous Tree is defined as a tree with any path from root node to leaf node has value or weight of nodes such that the absolute difference between the parent node and all of its direct children nodes is always 1.If we pick any node on the path from ... Read More

Count Derangements (Permutation such that no element appears in its original position) in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 09:51:27

490 Views

Derangement is permutation of N numbers such that no number appears at original position. For example one possible derangement of { 1, 2, 3 } is { 2, 1, 3 }. No element in this is at its original position. The goal here is to count the possible derangements for ... Read More

Content Management Systems An Overview

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 09:48:38

3K+ Views

If we go by the term Content Management System word to word, then it basically means a system of managing the content. It is defined as a collaborative platform with different features and functionalities that allow the creating, designing, publishing and maintaining web content easily and effectivelWhat is a Content ... Read More

Maximum length of balanced string after swapping and removal of characters in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 09:44:43

84 Views

We are given a string containing (, ), {, }, [, ] characters only. The goal is to find the maximum length of such string so that it becomes balanced by swapping adjacent characters or removing a character. We will do this by comparing adjacent characters, if they are opposite ... Read More

Maximum litres of water that can be bought with N Rupees in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 09:43:21

391 Views

We are given N rupees. The goal is to buy maximum water possible with the money where the rates of water bottles are as follows −Plastic Bottles: A Rupees for 1 litreGlass Bottles: B Rupees for 1 litreGlass Bottles: B Rupees for 1 litreNow the original cost of glass bottles ... Read More

Maximum in an array that can make another array sorted in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 09:42:18

93 Views

We are given an array of numbers say Arr1[] and another array Arr2[] of same or different length. The Arr1[] has elements sorted in ascending order, such that a single element is unsorted. We must find the element from the second array Arr2[] such that it can replace the wrongly ... Read More

Construct Turing machine for L = {an bm a(n+m) - n,m≥1} in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 03-Aug-2020 09:31:58

2K+ Views

Turing Machine − A Turing machine is a device used to accept words of a language generated by type 0 grammars. A Turing Machine (TM) is a mathematical model which consists of an infinite length tape divided into cells on which input is given. It consists of a head which ... Read More

Advertisements