Reorganize The Array
Given an array of elements arr[] with indices ranging from 0 to arr.size() – 1, your task is to write a program that rearranges the elements […]
Given an array of elements arr[] with indices ranging from 0 to arr.size() – 1, your task is to write a program that rearranges the elements […]
Given an array arr[] with repeated elements, the task is to find the maximum distance between two occurrences of an element. Note: You
Given a Matrix mat of n*n size. Your task is constructing a 2D linked list representation of the given matrix. Input: mat = [[1,
Find the largest pair sum in an array of distinct integers. Examples : Input: arr[] = [12, 34, 10, 6, 40] Output:
An ordinary Doubly Linked List requires space for two address fields to store the addresses of previous and next nodes.
Given a grid of size n*m (n is the number of rows and m is the number of columns in
Given a sorted array arr[] of positive integers, find the smallest positive integer such that it cannot be represented as the sum
Given a Circular Linked List. The task is to delete the given node, key in the circular linked list, and reverse the
You are given an array of integer nums[] where each number represents a vote to a candidate. Return the candidates that have
Given an array arr integers. Assume sz to be the initial size of the array. Do the following operations exactly sz/2 times. In every kth (1<= k <=
Given elements as nodes of the two singly linked lists. The task is to multiply these two linked lists, say
You are given an array arr[] of positive integers and a threshold value k. For each element in the array, divide it into