Arnab Chakraborty has Published 4282 Articles

Find Count of Single Valued Subtrees in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Oct-2019 13:37:05

483 Views

Suppose we have a binary tree. Our task is to count single valued subtrees in the given tree. A single valued subtree is a subtree, where all nodes of that tree is containing same value. Suppose a tree is like below −There are four Single value subtrees. These are like ... Read More

Find Corners of Rectangle using mid points in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Oct-2019 13:33:40

201 Views

Suppose we have a rectangle ABCD, but we have only the coordinates of the mid points P and Q, and the length of the rectangle L.Our task is to find the coordinates of A, B, C and D using the coordinates of P and Q, and the length of side ... Read More

Minimum Index Sum for Common Elements of Two Lists in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Oct-2019 13:29:49

219 Views

Suppose two person wants to choose different cities, they have listed out the cities in different list, we have to help the, to find common choices. So we need to find those cities, those are marked by both of them.This operation is very similar to the set intersection property, we ... Read More

Minimum Cost To Make Two Strings Identical in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Oct-2019 13:27:13

242 Views

Suppose we have two strings A and B, and another two cost values like CostA, and CostB. We have to find the minimum cost to make A and B identical. We can delete characters from string, the cost for deleting from string A is CostA, and cost for deleting from ... Read More

Minimum Cost to make two Numeric Strings Identical in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Oct-2019 13:25:44

184 Views

Suppose we have two numeric strings A and B. We have to find the minimum cost to make A and B identical. We can perform only one operation, that is we can delete digits from string, the cost for deleting a digit from number is same as the digit value. ... Read More

Minimize ASCII values sum after removing all occurrences of one character in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Oct-2019 13:20:09

172 Views

Suppose we have a string. We have to minimize the sum of ASCII values, of each character to the string, after removing every occurrence of a particular character. Suppose a string is given like “hello” the sum of ASCII characters is (104 + 101 + 108 + 108 + 111) ... Read More

Median and Mode using Counting Sort in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Oct-2019 13:18:44

426 Views

Consider we have an array of size n, we have to find the Median and Mode using the counting sort technique. This technique is useful, when the array elements are in limited range. Suppose the elements are {1, 1, 1, 2, 7, 1}, then the Mode is 1, and Median ... Read More

md5sum Command in Linux with Examples

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Oct-2019 13:16:14

594 Views

Here we will see the md5sum command in Linux system. The MD5 is one of the Message Digest algorithm, that generates hash values to create checksum for the messages. It helps to identify if the integrity is maintained or not. Here we will see some example of md5sum command in ... Read More

MCQ on Memory allocation and compilation process in C

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Oct-2019 12:52:48

546 Views

Here we will see some MCQ questions on Memory Allocation and Compilation Processes.Question 1 − What will be the output of the following code − Live Demo#include #include int main() {    union my_union {       int i;       float f;       char ... Read More

Maximum Possible Edge Disjoint Spanning Tree From a Complete Graph in C++

Arnab Chakraborty

Arnab Chakraborty

Updated on 21-Oct-2019 12:25:24

254 Views

Suppose we have a complete graph; we have to count number of Edge Disjoint Spanning trees. The Edge Disjoint Spanning trees are spanning trees, where no two trees in the set have an edge in common. Suppose the N (number of vertices) is 4, then output will be 2. The ... Read More

Advertisements