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

Convert String To Int

Convert string to int, requires us to convert a numeric string given to an integer. Here we are assuming, we are provided with a numeric string without white spaces either in the middle of the characters or at any one of the ends. We are also assuming that the string …

Read more

Binary Search Tree Search and Insertion

Problem Statement Write an algorithm to perform searching and insertion in Binary Search Tree. So what we are going to do is insert some of the elements from input into a binary search tree. Whenever asked to search a particular element, we’ll be searching it among the elements in BST(short …

Read more

Translate »