Php Program to Form coils in a matrix
Given a positive integer n which represents the dimensions of a 4n x 4n matrix with values from 1 to n filled from left to right and top to bottom. Form two coils from the matrix and print the coils....
read more
Yahoo Acquires Instagram Co-Founders’ AI News Platform Artifact
In a move shaking up the online news world, Yahoo announced the acquisition of Artifact, an AI-powered news startup founded by Instagram’s co-founders, Kevin Systrom and Mike Krieger. This acquisition means Yahoo’s strategic shift towards Yahoo AI news and using the power of AI for a more personalized news experience....
read more
Given a number, find the next smallest palindrome
Given a number, find the next smallest palindrome larger than this number. For example, if the input number is “2 3 5 4 5”, the output should be “2 3 6 3 2”. And if the input number is “9 9 9”, the output should be “1 0 0 1”. The input is assumed to be an array. Every entry in array represents a digit in input number. Let the array be ‘num[]’ and size of array be ‘n’...
read more
Serialize and Deserialize a Binary Tree
Serialization is to store the tree in a file so that it can be later restored. The structure of the tree must be maintained. Deserialization is reading the tree back from a file....
read more
Java Program to Form coils in a matrix
Given a positive integer n which represents the dimensions of a 4n x 4n matrix with values from 1 to n filled from left to right and top to bottom. Form two coils from the matrix and print the coils....
read more
Queue based approach for first non-repeating character in a stream
Given a stream of characters and we have to find first non repeating character each time a character is inserted to the stream....
read more
Find Median from Running Data Stream
Given that integers are read from a data stream. Find the median of elements read so far in an efficient way....
read more
Find the number of zeroes
Given an array of 1s and 0s which has all 1s first followed by all 0s. Find the number of 0s. Count the number of zeroes in the given array.Examples :...
read more
Find two prime numbers with given sum
Given an even number (greater than 2 ), print two prime numbers whose sum will be equal to given number. There may be several combinations possible. Print only first such pair. An interesting point is, a solution always exist according to Goldbach’s conjecture.Examples :...
read more
Python Program to Form coils in a matrix
Given a positive integer n which represents the dimensions of a 4n x 4n matrix with values from 1 to n filled from left to right and top to bottom. Form two coils from the matrix and print the coils....
read more
Find the first non-repeating character from a stream of characters
Given a stream of characters, find the first non-repeating character from the stream. You need to tell the first non-repeating character in O(1) time at any moment....
read more
Median of Stream of Running Integers using STL
Given that integers are being read from a data stream. Find the median of all the elements read so far starting from the first integer till the last integer. This is also called the Median of Running Integers. The data stream can be any source of data, for example, a file, an array of integers, input stream etc....
read more