Sunidhi Bansal has Published 1085 Articles

Count number of edges in an undirected graph in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 06-Jun-2020 11:23:54

1K+ Views

Given the task is to count the number of edges in an undirected graph. An undirected graph is a set of vertices which are connected together to form a graph, whose all the edges are bidirectional. Undirected graphs can travel in any direction from one node to another connected node.Below ... Read More

Count number of bits changed after adding 1 to given N in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 12:52:46

202 Views

We are given a number let’s say num and the task is to calculate the total number of bits changed when 1 is added to a number.Binary representation of a number is done by converting the given number into the form of 0’s and 1’s and it is done by ... Read More

Count number of binary strings of length N having only 0’s and 1’s in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 12:50:50

513 Views

We are given a number let’s say, num and the task is to calculate the count of binary strings that can be formed through the given number num containing only o’s and 1’s.Binary Number System is one the type of Number Representation techniques. It is most popular and used in ... Read More

Count full nodes in a Binary tree (Iterative and Recursive) in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 12:48:59

1K+ Views

We are given a binary tree and the task is to calculate the count of full nodes available in a binary tree using iterative and recursive approach. Full nodes are those nodes who have both the children and no child is null. Note that in full nodes we consider nodes ... Read More

Count half nodes in a Binary tree (Iterative and Recursive) in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 12:43:29

449 Views

We are given a binary tree and the task is to calculate the count of half nodes available in a binary tree using iterative and recursive approach. Half nodes are those nodes who have only one child and another child is null. Note that in half nodes we don't consider ... Read More

Count elements in a vector that match a target value or condition in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 12:23:16

618 Views

We are given a vector and the task is to calculate the count of those elements in a vector that matches a target value or condition.Vectors are sequence containers that can change size. Container is an object that holds data of the same type. Sequence containers store elements strictly in ... Read More

Count consonants in a string (Iterative and recursive methods) in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 12:21:38

709 Views

We are given a string with let’s say str of any length and the task is to calculate the count of consonants in the given string using both iterative and recursive methods.Consonants are those alphabets that are not vowel i.e alphabets except a, i, e, o, u are considered as ... Read More

Count common subsequence in two strings in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 12:19:02

607 Views

We are given two strings, let's say str1 and str2 containing characters and the task is to calculate the common subsequences in both the strings. In the below program we are using dynamic programming and for that we need to know what dynamic programming is and at what problems it ... Read More

Count changes in Led Lights to display digits one by one in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 12:16:03

309 Views

We are given a positive number let’s say num and the task is to calculate the count of changes in the Led lights displayed one by one. We will assume that initially all LEDs are off and they will be started based upon the string value.For solving this question we ... Read More

Count number of digits after decimal on dividing a number in C++

Sunidhi Bansal

Sunidhi Bansal

Updated on 15-May-2020 12:13:39

576 Views

We are given two integer numbers let’s say num1 and num2 and the task is to divide the num1 with num2 and calculate the count of digits after decimal on dividing these given numbers.For ExampleInput − num1 = 2, num2 = 5 Output − count is 1Explanation − when we ... Read More

Advertisements