Sudhir sharma has Published 1149 Articles

Print Binary Tree levels in sorted order in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 09:33:48

192 Views

In this problem, we are given a binary tree and we have to print all nodes at a level in sorted order of their values.Let’s take an example to understand the concept better, Input −Output −20 6 15 2 17 32 78To solve this problem, we need to print a sorted ... Read More

Print bitwise AND set of a number N in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 09:30:29

143 Views

In this problem, we have to print all the numbers from 0 to n which are Bitwise AND of a binary of n.Let’s take an example to understand the concept better.Input : N = 4. Output : 0 4 Explanation :    0 & 4 = 0    1 & ... Read More

Print BST keys in the given range in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 09:28:26

668 Views

In this problem, we are given two nodes of a binary search tree. And we have to print all the values in the range of k1 to k2 that occur in the tree. That is we have to print all the values that are greater than k1 and smaller than ... Read More

Print Bracket Number in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 09:23:18

363 Views

In this problem, we are given expression. And we have to print the bracket number sequence. Let’s look at an example to understand the problem better.Example, Input : ((()())()) Output : 1233442551Explanation − Here we have encountered 5 bracket pairs and we have printed them in a sequence of their[ ... Read More

Print calendar for a given year in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 09:06:07

4K+ Views

In this problem, we are given a year and we want to print the calendar for that year.The year calendar shows all days, months on every date of the month. And here we will create a program that will return the calendar of the current year.For this, we will need ... Read More

Print characters and their frequencies in order of occurrence in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 08:10:11

545 Views

This problem, We are given a string of lowercase characters. and we have to find the frequencies of each character that occurs in the string. the below example when explaining more about the problem.Input : “jskdk” Output : j 1 s 1 k 2 d 1Explanation − In the String, ... Read More

Print characters having odd frequencies in order of occurrence in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 08:07:43

436 Views

In this problem, we are given string str by the user. And we have to print only those characters whose frequencies of occurrence in an odd number.To solve this problem, we have to find the total frequency of occurrence of a character in a string. And print only those characters ... Read More

Print colored message with different fonts and sizes in C

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 08:05:02

3K+ Views

C/C++ programming language, the user is provided with functionality to customize the output based on the requirement of the user. C/C++ graphics functions are included in graphics.h header file. Using this library you can create different objects, set the color of text, change the font and size of the text ... Read More

Print common characters of two Strings in alphabetical order in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 08:02:35

746 Views

In this programming problem, we are given two strings. And we have to find all the characters of the string that are common in both the string and we have to print these common characters in alphabetical order. And print ‘NO COMMON CHARACTERS ’ found if no common letters arise. ... Read More

Print common nodes on path from root (or common ancestors) in C++

sudhir sharma

sudhir sharma

Updated on 03-Jan-2020 07:56:25

168 Views

In this problem, we are given a binary tree and two nodes of the binary tree are defined. And we have to print all the common ancestors of the node i.e. common nodes that occur in the path from traversal from root to the node.Binary Tree is a special tree ... Read More

Advertisements