Add two numbers

Add two numbers is a problem in which we have given two non-empty linked list representing a non-negative integer. The digit are store in reverse order and every node must contain only a single digit. Add the two numbers and print the result by using a linked list. Input Format …

Read moreAdd two numbers

Fibonacci numbers

Fibonacci numbers are the numbers that form the series called Fibonacci series and are represented as Fn. The first two Fibonacci numbers are 0 and 1 respectively i.e. F0=0 and F1=1. Starting from the third Fibonacci number each Fibonacci number is the sum of its previous two numbers in the …

Read moreFibonacci numbers

Minimum number of Merge Operations to make an Array Palindrome

Problem Statement In the “Minimum number of Merge Operations to make an Array Palindrome” problem we have given an array “a[]”. Find the minimum number of merge_operations are required to make an array palindrome. Note, A palindrome is a word, phrase, or sequence that reads the same backward as forwards. …

Read moreMinimum number of Merge Operations to make an Array Palindrome

Print all Possible Combinations of R Elements in a given Array of size N

Problem Statement In the “Print all Possible Combinations of R Elements in a given Array of size N” problem, we have given an array of size n. Find all combinations of size r in the array. Input Format Th first and only one line containing an integer N. Second-line containing …

Read morePrint all Possible Combinations of R Elements in a given Array of size N