A program to check if a binary tree is BST or not

Problem Statement “A program to check if a binary tree is BST or not” states that you are given a binary tree and you need to check if the binary tree satisfies the properties of the binary search tree. So, the binary tree has the following properties:  The left subtree …

Read more

Maximum Depth Of Binary Tree

Problem Statement “Maximum depth of binary tree” problem states that you are given a binary tree data structure. Print the maximum depth of the given binary tree. Example Input 2 Explanation: Maximum depth for the given tree is 2. Because there is only a single element below the root (i.e. …

Read more

Reverse Integer

Problem Statement “Reverse Integer” problem states that you are given an integer variable n containing the number to be reversed. Write a program to reverse its digits. Reversing an integer is nothing different from reversing a string. We can easily convert an integer into a string. And then use the …

Read more

Seconds to Days

Problem Statement “Seconds To Days” problem states that you are given an integer s referring to the seconds. Print the corresponding number of the days, hours, minutes, and seconds. Example s = 1543765 17dd 20hh 49mm 25ss Explanation: Converting the given input into the required format. We get 17 d, …

Read more

Translate »