Skip to content

Tag Archives: array-stream

Given an array arr[] of size N representing integers required to be read as a data stream, the task is to calculate and print the… Read More
Given an array, arr[] of size N whose elements from left to right, must be read as an incoming stream of integers, the task is… Read More
Given that integers are being read from a data stream. Find the mode of all the elements read so far starting from the first integer… Read More
Given a stream of numbers as arr, the task is to find the rank of each element in the stream in descending order when they… Read More
Stream toArray() returns an array containing the elements of this stream. It is a terminal operation i.e, it may traverse the stream to produce a… Read More
In this article, we would be going through stream method of Arrays class which is added in Java 8, it simplifies many operations on arrays… Read More
Given an array of n numbers. Your task is to read numbers from the array and keep at-most K numbers at the top (According to… Read More
Given a stream of characters and we have to find first non repeating character each time a character is inserted to the stream. Examples: Input… Read More
Given a stream of integers represented as arr[]. For each index i from 0 to n-1, print the multiplication of largest, second largest, third largest… Read More
Stream of binary number is coming, the task is to tell the number formed so far is divisible by a given number n. At any… Read More
Given an infinite stream of integers, find the k’th largest element at any point of time.Example:  Input: stream[] = {10, 20, 11, 70, 50, 40,… Read More
Given a stream of characters (characters are received one by one), write a function that prints ‘Yes’ if a character makes the complete string palindrome,… Read More
Given a stream of characters, find the first non-repeating character from stream. You need to tell the first non-repeating character in O(1) time at any… Read More
Given a stream of numbers, generate a random number from the stream. You are allowed to use only O(1) space and the input is in… Read More
Difficulty Level: Rookie Given a stream of numbers, print average (or mean) of the stream at every point. For example, let us consider the stream as… Read More