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 …

Read moreImplementation of Deque using Doubly Linked List

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 …

Read moreCheck whether a given Binary Tree is Complete or not

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

Read moreFind sum of non-repeating elements (distinct) elements in an array

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 …

Read moreRemove Minimum Number of Elements Such That no Common Element Exist in both Array

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 …

Read moreProgram to Toggle all Characters in a String