Quick Sort on Linked List
You are given a Linked List. Sort the given Linked List using quicksort. Examples: Input: Linked list: 1->6->2Output: 1->2->6Explanation:After sorting the […]
You are given a Linked List. Sort the given Linked List using quicksort. Examples: Input: Linked list: 1->6->2Output: 1->2->6Explanation:After sorting the […]
You are given an integer array nums. A subsequence of nums is called a square streak if: The length of the subsequence is at least 2,
Given an array arr consisting of positive integer numbers, remove all duplicate numbers. Example: Input: arr[] = [2, 2, 3, 3, 7,
Given a m * n matrix of ones and zeros, return how many square submatrices have all ones. Example 1: Input: matrix = [
Given an array arr of integers. Find whether three numbers are such that the sum of two elements equals the third element.
You are given the root of a binary tree with n nodes. Each node is assigned a unique value from 1 to n. You are also given an array queries of
Given a singly linked list and a key, count the number of occurrences of the given key in the linked list. Examples: Input: Linked List:
Given a list of folders folder, return the folders after removing all sub-folders in those folders. You may return the answer in any order. If
Given an array arr of distinct integers. Rearrange the array in such a way that the first element is the largest and the second
For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child
Given an array arr. Return the modified array in such a way that if the current and next numbers are valid numbers and
Given the root of a binary tree, replace the value of each node in the tree with the sum of all its cousins’