Sudhir sharma has Published 1206 Articles

Possible cuts of a number such that maximum parts are divisible by 3 in C++

sudhir sharma

sudhir sharma

Updated on 17-Apr-2020 07:43:24

78 Views

In this problem, we are given a large integer value (with up to 105 digits). Our task is to print the total number of cuts required such that maximum parts are divisible by 3.Let’s take an example to understand the problemInput − 9216Output − 3Explanation − the number is divided ... Read More

Possible moves of knight in C++

sudhir sharma

sudhir sharma

Updated on 17-Apr-2020 07:41:13

817 Views

In this problem, we are given an m*n chessboard with filled positions marked by 1 i.e. if board[i][j] = 1, there is some piece there and we are given the starting position. Our task is to find the total number of possible moves for a knight in the board, if ... Read More

Possible number of Rectangle and Squares with the given set of elements in C++

sudhir sharma

sudhir sharma

Updated on 17-Apr-2020 07:37:24

280 Views

In this problem, we are given an array of N integers denoting the length of n sticks. Our task is to print the count of rectangles and squares that can be created from the sticks of the given length.Let’s take an example to understand the problemInput − array = {5, 5, ... Read More

Possible timings in C++

sudhir sharma

sudhir sharma

Updated on 17-Apr-2020 07:29:13

42 Views

In this problem, we are given two-digit timing using a glow digit display or seven-segment display (as in calculator). Our task is to calculate the possibility of occurrence of other timings that can occur by glowing or deleting one bit of the display.Seven-segment display is a special display that is ... Read More

Possible to form a triangle from array values in C++

sudhir sharma

sudhir sharma

Updated on 17-Apr-2020 07:26:45

4K+ Views

In this problem, we are given an array of integers. Our task is to check if the creation of a non-degenerate triangle taking the elements of the array as sides of the triangle.Non-degenerate triangle − it is a triangle that has a positive area. The condition for a non-degenerate triangle ... Read More

Possible to make a divisible by 3 number using all digits in an array in C++

sudhir sharma

sudhir sharma

Updated on 17-Apr-2020 07:23:54

556 Views

In this problem, we are given an array. Our task is to check whether a number generated by using all digits of the elements of the array is divisible by 3. If possible then print “Yes” otherwise print “No”.Let’s take an example to understand the problemInput − arr = {3, ... Read More

Possible two sets from first N natural numbers difference of sums as D in C++

sudhir sharma

sudhir sharma

Updated on 17-Apr-2020 07:21:44

45 Views

In this problem, we are given two integer N and D. Our task is to check whether it is possible to have to sets from the set of first N natural numbers that have a difference of D.Let’s take an example to understand the problem, Input − N=5 D =3Output − ... Read More

Postfix to Infix in C++

sudhir sharma

sudhir sharma

Updated on 17-Apr-2020 07:15:33

5K+ Views

In this problem, we are given expression in postfix form and our task is to print the infix form of the expression.Infix expression is an expression in which the operator is in the middle of operands, like operand operator operand.Postfix expression is an expression in which the operator is after ... Read More

Postorder successor of a Node in Binary Tree in C++

sudhir sharma

sudhir sharma

Updated on 17-Apr-2020 07:12:30

521 Views

In this problem, we are given a binary tree and node. Our task is to print the postorder successor of the node in Binary tree.Binary tree is a special type of tree in which each node can have at max 2 child nodes.Postorder Traversal is a tree traversal technique, in ... Read More

Postorder traversal of Binary Tree without recursion and without stack in C++

sudhir sharma

sudhir sharma

Updated on 17-Apr-2020 07:03:44

312 Views

In this problem, we are given a Binary tree. Our task is to print the postorder traversal of the binary tree without using recursion and without stack.Binary tree is a special type of tree in which each node can have at max 2 child nodes.Postorder Traversal is a tree traversal ... Read More

Advertisements