Sunidhi Bansal has Published 1085 Articles

Count Balanced Binary Trees of Height h in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 28-Jul-2020 10:52:45

394 Views

We are given with the height H of a binary tree. The goal is to find the number/count of balanced Binary Trees of given height.A binary tree − is a tree data structure in which each node has at most two children, which are the left child and the right ... Read More

Sets of pairs in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 28-Jul-2020 10:50:15

8K+ Views

Set in C++ is an associative container and contains unique elements. All the elements once added to a specific cannot be modified. One can only remove and add elements in order to change them.Pair is defined under header and is used to couple together two pair values. The pair ... Read More

set operator= in C++ STL

Sunidhi Bansal

Sunidhi Bansal

Updated on 28-Jul-2020 10:47:26

271 Views

The function operator= is used in sets to copy one set (or move to another in C++ STL. It behaves as a normal ‘=’ assignment operation for sets. There are there overloaded forms of this function −copy :- set& operator= (const set& s1) −This function copies all the elements in ... Read More

round() in C++.

Sunidhi Bansal

Sunidhi Bansal

Updated on 28-Jul-2020 10:42:58

16K+ Views

The round() function in C++ is used to round off the double, float or long double value passed to it as a parameter to the nearest integral value. The header file used to use the round() function in a c++ program is or .Following are the overloaded versions of ... Read More

Rotation of a point about another point in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 28-Jul-2020 10:41:29

1K+ Views

Rotation of a point X about origin is by an angle θ in anti-clockwise direction is done by − X by θ about origin anti-clRotateockwise: X*polar( 1.0, θ ).Here, the function polar for complex numbers is defined under header file and is used to find a complex number using phase ... Read More

Relational Operators on STL Array in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 28-Jul-2020 10:39:05

343 Views

There are six relational operators for comparison of operands of the same type. These are >,

Count columns to be deleted to make each row sorted in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 28-Jul-2020 10:33:43

118 Views

The abnormal behavior of C++ programs often leads to program crash. You may have encountered problems like Segmentation fault, Aborted, Floating point exception etc. Following are sample programs that may help you to understand the reasons for a C++ program crash.ExceptionsExceptions in C++ are responses of a program when it ... Read More

Range-based for loop in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 28-Jul-2020 10:30:46

4K+ Views

The range based for loop is added in C++ 11 standard and is a more compact form of its traditional equivalent. The range based for loop is used to iterate over elements of a container from beginning to end. The syntax for range-based for loop is as follows −Syntaxfor( range-declaration ... Read More

C++ Program for Deadlock free condition in Operating Systems

Sunidhi Bansal

Sunidhi Bansal

Updated on 09-Jul-2020 08:50:06

4K+ Views

Given with the P number of processes in the memory and N number of needed resources by them to complete their execution and the task is to find the minimum number of resources R which should be allotted to the processes such that deadlock will never occur.What is a DeadlockDeadlock ... Read More

C program for Binomial Coefficients table

Sunidhi Bansal

Sunidhi Bansal

Updated on 09-Jul-2020 08:48:19

8K+ Views

Given with a positive integer value let’s say ‘val’ and the task is to print the value of binomial coefficient B(n, k) where, n and k be any value between 0 to val and hence display the result.What is Binomial CoefficientBinomial coefficient (n, k) is the order of choosing ‘k’ ... Read More

Advertisements