## Difference between Queue and Deque in C++

Prabhdeep Singh

Updated on 24-Aug-2023 14:24:13

87 Views

Queue and Deque both are linear data structures that are defined in STL of C++ programming language. Queue works on the principle of the first in first out, the element added to the queue first will be removed first, on the other hand, deque has properties to add an element ... Read More

## Distance of each node of a Binary Tree from the root node using BFS

Prabhdeep Singh

Updated on 24-Aug-2023 14:21:07

17 Views

Binary Tree is a non-linear data structure. It has a maximum of two children and each node contain three things that are data value, left and right pointer. The top node is called the root node and the last node which does contain any children is called the leave node. ... Read More

## Find the Largest and smallest number in an Array containing small as well as large numbers

Prabhdeep Singh

Updated on 24-Aug-2023 14:19:04

19 Views

We are given an array of strings and each string represents a number that could be more than the range of the maximum integer limit. We have to find the largest and the smallest element from the given array. We cannot use the simple less than or greater than operators ... Read More

## Longest Substring containing C2, starting with C1 and ending with C3

Prabhdeep Singh

Updated on 24-Aug-2023 14:17:12

21 Views

A substring is a string that can be achieved from the given string by removing some characters from the beginning and end of the string (possibly none or all). We are given a string and three characters and have to find the longest substring that contains all the three given ... Read More

## Count of N length Strings having S as a Subsequence

Prabhdeep Singh

Updated on 24-Aug-2023 14:15:40

22 Views

We are given a string of length S and given an another number n which represents the length of the strings which might contains S as the subsequence. We have to find the number of unique strings of length N which contains S as the subsequence, where a subsequence is ... Read More

## Count of Subsequences of given string X in between strings Y and Z

Prabhdeep Singh

Updated on 24-Aug-2023 14:13:15

24 Views

A subsequence is a string that can be achieved from another string by removing some (possibly none or all) from a given string that may not be continuous. We are given a string and have to find the number of subsequences that are greater than equal to the given string ... Read More

## Longest Substring with at most X 0s and Y 1s of given String

Prabhdeep Singh

Updated on 24-Aug-2023 14:11:39

30 Views

A substring is the continuous sequence of the character from the given string which can be achieved by removing some character from the front and the end of the substring (possibly all or none). We are given a binary string and we have to find the length of the longest ... Read More

## XOR of all substrings of a given Binary String

Prabhdeep Singh

Updated on 24-Aug-2023 14:09:57

21 Views

A binary string is a string that contains only two different types of characters in it which are '0' and '1'. Substrings are strings that are formed by deleting some character from the given string from the beginning and from the ending (possibly zero or all). We are given a ... Read More

## Minimum cost to delete characters from String A to remove any subsequence as String B

Prabhdeep Singh

Updated on 24-Aug-2023 14:02:39

14 Views

We are given two strings string A and string B along with an array that represents the cost to delete the ith character of the given string A. We need to delete some characters of string A (possibly zero or none) with the minimum cost such that no subsequence of ... Read More

## Transform string A into B by deleting characters from ends and reinserting at any position

Prabhdeep Singh

Updated on 24-Aug-2023 13:56:43

16 Views

Anagram of a string means a string contains exact same characters as another string with the order of characters may vary from the original string, so we called that both strings are anagram of each other. Here we have given the two strings first and second which are anagrams of ... Read More