christinasherin4 / Tutree-Intern

Paper-1 ,paper-2,paper-3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tutree-Intern

Paper-1 ,paper-2,paper-3

Paper - 1

Q1- Find the smallest and second smallest elements in an array.

Explanation- Write an efficient C program to find smallest and second smallest element in an array

Example:

Input: arr[] = {12, 13, 1, 10, 34, 1} Output: The smallest element is 1 and second Smallest element is 10

Q2-Find median in a stream of integers (running integers)

Explanation- Given that integers are read from a data stream. Find median of elements read so for in efficient way. For simplicity assume there are no duplicates. For example, let us consider the stream 5, 15, 1, 3 …

After reading 1st element of stream - 5 -> median - 5 After reading 2nd element of stream - 5, 15 -> median - 10 After reading 3rd element of stream - 5, 15, 1 -> median - 5 After reading 4th element of stream - 5, 15, 1, 3 -> median - 4, so on...

About

Paper-1 ,paper-2,paper-3


Languages

Language:C++ 100.0%