## Implementation of Deque using Doubly Linked List

Problem Statement The problem “Implementation of Deque using Doubly Linked List” states that you need to implement the following functions of Deque or Doubly Ended Queue using a doubly linked list, insertFront(x) : Add element x at the starting of Deque insertEnd(x) : Add element x at the end of …

## Check whether a given Binary Tree is Complete or not

Problem Statement The problem “Check whether a given Binary Tree is Complete or not” states that you are given the root of a binary tree, check whether the tree is complete or not. A complete Binary Tree has all its levels filled except for the last level and the nodes …

## Find sum of non-repeating elements (distinct) elements in an array

Problem Statement Given an integer array, A[] with repeated elements, the “Find sum of non-repeating elements (distinct) elements in an array” problem asks to find the sum of all distinct elements in the array. So, simply add the numbers which are not repeated in the array. Example A[]={1, 4, 2, …

## Remove Minimum Number of Elements Such That no Common Element Exist in both Array

Given two arrays A and B consisting of n and m elements respectively. Remove minimum number of elements such that no common element exist in both array and print the count of elements which removed. Example Input: A[]={ 1, 2, 1, 1} B[]= {1, 1} Output: Minimum elements to remove …

## Program to Toggle all Characters in a String

Problem Statement In the “Program to Toggle all Characters in a String” problem we have given a string, write a program to toggle all characters of the given string. Here toggle means converting all the uppercase characters to lowercase and all lowercase characters to uppercase characters. Input Format The first …

## 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 …

## Maximum Sum of Non Consecutive Elements

Problem Statement In the “Maximum Sum of Non Consecutive Elements” given array, you need to find the maximum sum of non-consecutive elements. You can not add immediate neighbor numbers. For example [1,3,5,6,7,8,] here 1, 3 are adjacent so we can’t add them, and 6, 8 are not adjacent so we …

Translate ยป