## Print the path between any two nodes of a tree | DFS

Given a tree of distinct nodes N with N-1 edges and a pair of nodes P. The task is to find and print the path… Read More »

- What is Competitive Programming and How to Prepare for It?
- Make the list non-decreasing by changing only one digit of the elements
- Nth XOR Fibonacci number
- Write a function to get the intersection point of two Linked Lists | Set 2
- Number of substrings that start with "geeks" and end with "for"
- Find a pair (n,r) in an integer array such that value of nPr is maximum
- Check if a cycle of length 3 exists or not in a graph that satisfy a given condition
- Count occurrences of a prime number in the prime factorization of every element from the given range
- Reversing a Queue using another Queue
- Minimum increment or decrement operations required to make the array sorted
- Check if the rows of a binary matrix can be made unique by removing a single column
- Number of Subarrays with positive product
- Queries for the minimum element in an array excluding the given index range
- Longest Increasing Subsequence using Longest Common Subsequence Algorithm
- Print nodes having maximum and minimum degrees
- Color all boxes in line such that every M consecutive boxes are unique
- Minimize the sum of the array according the given condition
- Count of triples (A, B, C) where A*C is greater than B*B
- Find two co-prime integers such that the first divides A and the second divides B
- Sum of all natural numbers from L to R ( for large values of L and R )
- Largest sub-matrix with all equal elements
- Minimize the cost of partitioning an array into K groups
- Maximum length sub-array which satisfies the given conditions
- Find out the prime numbers in the form of A+nB or B+nA
- Check if the Matrix satisfies the given conditions
- Find a pair (n,r) in an integer array such that value of nCr is maximum
- Count of Multiples of A ,B or C less than or equal to N
- Sort elements by modulo with K
- time.h localtime() function in C with Examples
- Interactive Problems in Competitive Programming | Set 2

Given a tree of distinct nodes N with N-1 edges and a pair of nodes P. The task is to find and print the path… Read More »

Given an array arr[] of size N. The task is to find the sum of the digits of all array elements which contains even number… Read More »

Given an integer N. The task is to count the numbers of pairs of integers A and B such that A + B + N… Read More »

Given a tree of N nodes and an integer K, each node is numbered between 1 and N. The task is to find the number… Read More »

Given a directed graph with N vertices and M edges that may contain cycles, the task is to find the lexicographically smallest topological ordering of… Read More »

Given an array arr[] of N integers and an integer K. The task is to find the maximum xor subset of size K of the… Read More »

Given an array arr[] of N integers, the task is to sort the array without changing the position of negative numbers (if any) i.e. the… Read More »

Given two integers X and Y. The task is to find two vertices of an isosceles triangle ABC(right-angled at B) which has one vertex at… Read More »

Given a binary string S, consisting of 0’s and 1’s. You have to accommodate the 0’s and 1’s into the K buckets in such a… Read More »

Given an undirected unweighted graph with N vertices and M edges. The task is to find two disjoint good sets of vertices. A set X… Read More »

Given an array of size N and an integer K. The array consists of only digits {0, 1, 2, 3, …k-1}. The task is to… Read More »

Given an integer N, the task is to find the Nth Mosaic number. A Mosaic number can be expressed as follows: If N = Aa… Read More »

Given an integer N, the task is to print the first N terms of the Lower Wythoff sequence. Examples: Input: N = 5 Output: 1,… Read More »

Given a array ‘a[]’ of size n and number of queries q. Each query can be represented by a integer m. Your task is to… Read More »

Given an integer N, the task is to count the number of possible Binary Search Trees with N keys. Examples: Input: N = 2 Output:… Read More »