Cerinta completa The LRT Company has employees. Each employee has a unique ID number from to , where the director’s ID is number . Every employee in the company has exactly one immediate supervisor — except the director, who has
BST maintenance
Cerinta completa Consider a binary search tree T which is initially empty. Also, consider the first N positive integers {1, 2, 3, 4, 5, ….., N} and its permutation P {a1, a2, …, aN}. If we start adding these numbers
Array Pairs
Cerinta completa Consider an array of integers, . Find and print the total number of pairs such that where . Input Format The first line contains an integer, , denoting the number of elements in the array. The second line
Find the Running Median
Cerinta completa The median of a set of integers is the midpoint value of the data set for which an equal number of integers are less than and greater than the value. To find the median, you must first sort
Burger Happiness
Cerinta completa In Burger Town new burger restaurants will be opened! Concretely, restaurants will open in days, while restaurant will be opened on day and will be located at . The town should be imagined as an one dimensional line
Fibonacci Numbers Tree
Cerinta completa Shashank loves trees and math. He has a rooted tree, , consisting of nodes uniquely labeled with integers in the inclusive range . The node labeled as is the root node of tree , and each node in
2D Array – DS
Cerinta completa Given a 2D array, , an hourglass is a subset of values with indices falling in the following pattern: a b c d e f g There are hourglasses in a array. The is the sum of the
Binary Search Tree : Insertion
Cerinta completa You are given a pointer to the root of a binary search tree and values to be inserted into the tree. Insert the values into their appropriate position in the binary search tree and return the root of
Arrays – DS
Cerinta completa An array is a data structure that stores elements of the same type in a contiguous block of memory. In an array, , of size , each memory location has some unique index, (where ), that can be
Zurikela’s Graph
Cerinta completa Zurikela is creating a graph with a special graph maker. At the begining, it is empty and has no nodes or edges. He can perform types of operations: : Create a set of new nodes and name it
