Skip to content

Tag Archives: deque

Given an array arr[] consisting of N integers and an integer K, the task is to print the maximum sum possible in a subsequence satisfying… Read More
Queue: A Queue is a linear data structure that follows a First In First Out (FIFO) order in which the operations are performed. It is… Read More
Given integers N, L and R, the task is to generate a Bitonic Sequence of length N from the integers in the range [L, R]… Read More
Given a Linked List of even number of nodes, the task is to generate a new Linked List such that it contains the maximum difference… Read More
Given two positive integers N and K and an array F[] consisting of K positive integers. The Nth term of the recurrence relation is given… Read More
Deque is a Double Ended Queue which is implemented using the collections module in Python. Let us see how can we get the first and… Read More
Given a string str, the task is to find the substring of length K which occurs the maximum number of times. If more than one… Read More
Given an array A[] consisting of N integers and an integer K, the task is to maximize the length of the subarray having equal elements… Read More
Given an array arr[] of size N and queries Q[][], the task is to perform the following types of queries on the given array. 0:… Read More
Given string str of length N and an integer K, the task is to return the largest string in Dictionary Order by erasing K characters… Read More
Given a non-decreasing array arr[] and an integer K, the task is to remove K elements from the array such that maximum difference between adjacent… Read More
Given a Binary Tree, the task is to print spiral order traversal of the given tree. For below tree, the function should print 1, 2,… Read More
Given a singly linked list and an integer K, the task is to reverse every K nodes of the given linked list.Examples:  Input: 1 ->… Read More
Given a string S containing letters and ‘#‘. The ‘#” represents a backspace. The task is to print the new string without ‘#‘. Examples: Input… Read More
Given a Linked List of integers. The task is to write a program to modify the linked list such that all even numbers appear before… Read More