## Program to count Number of connected components in an undirected graph

Given an undirected graph g, the task is to print the number of connected components in the graph. Examples: Input: Output: 3 There are three… Read More »

- TCS Coding Practice Question | Check Armstrong Number
- TCS Coding Practice Question | Check Odd or Even
- How to find the minimum and maximum element of a Vector using STL in C++?
- TCS Coding Practice Question | LCM of 2 Numbers
- TCS Coding Practice Question | Fibonacci Series
- TCS Coding Practice Question | HCF or GCD of 2 Numbers
- Find the longest string that can be made up of other strings from the array
- Count substrings that contain all vowels | SET 2
- TCS Coding Practice Question | Concatenate 2 Strings
- Programs for printing pyramid patterns using recursion
- Program to find the kth character after decrypting a string
- TCS Coding Practice Question | Swap two Numbers
- TCS Coding Practice Question | Prime Numbers upto N
- TCS Coding Practice Question | Checking Leap Year
- Generics in C++
- TCS Coding Practice Question | Checking Prime Number
- TCS Coding Practice Question | Greatest of 3 Numbers
- TCS Coding Practice Question | Average of 2 Numbers
- How to reverse an Array using STL in C++?
- TCS Coding Practice Question | Sum of Digits of a number
- Program to count Number of connected components in an undirected graph
- How to convert a class to another class type in C++?
- TCS Coding Practice Question | Factorial of a Number
- Maximum length of subarray such that sum of the subarray is even
- Count the number of 1's and 0's in a binary array using STL in C++ ?
- How to sort an Array in descending order using STL in C++?
- Maximum sub-tree sum in a Binary Tree such that the sub-tree is also a BST
- Clockwise Spiral Traversal of Binary Tree | Set - 2
- Program to check if an Array is Palindrome or not using STL in C++
- Remove duplicates from an unsorted array using STL in C++

Given an undirected graph g, the task is to print the number of connected components in the graph. Examples: Input: Output: 3 There are three… Read More »

Given a number N, the task is to check if N is a Leap Year or not using Command Line Arguments. Examples: Input: N =… Read More »

Given a number N, the task is to check if N is a Prime Number or not using Command Line Arguments. Examples: Input: N =… Read More »

Given a number N, the task is to find the Prime Numbers from 1 to N using Command Line Arguments. Examples: Input: N = 7… Read More »

Given a number, the task is to find the Sum of Digits of this number using Command Line Arguments. Examples: Input: num = 687 Output:… Read More »

Given that a certain amount of money becomes T1 times itself in N1 years. The task is to find the number of years i.e. N2… Read More »

Given a binary array, the task is to count the number of 1’s and 0’s in this array using STL in C++. Examples: Input: arr[]… Read More »

Given an array, the task is to find elements which are odd and even, using STL in C++ Examples: Input: a[] = {1, 2, 3,… Read More »

Given an array and an integer N, find elements which are divisible by N, using STL in C++ Examples: Input: a[] = {1, 2, 3,… Read More »

Given an array, the task is to print or display all the reverse permutations of this array using STL in C++. Reverse permutation means, for… Read More »

Generics is the idea to allow type (Integer, String, … etc and user-defined types) to be a parameter to methods, classes and interfaces. For example,… Read More »

Given a mat[][] of size n X n, the task is to find an element X such that if the anti-clockwise traversal is begun from… Read More »

Given an array arr[] of n elements, the task is to replace all the odd positioned elements with their cubes and even positioned elements with… Read More »

Given an array, the task is to shuffle the whole array and print it. Example Input (1, 2, 3, 4, 5, 6, 7} Output {3,… Read More »

Given a binary tree, the task is to print the maximum sum of nodes of a sub-tree which is also a Binary Search Tree. Examples:… Read More »