Game of Two Stacks

Cerinta completa Alexa has two stacks of non-negative integers, stack and stack where index denotes the top of the stack. Alexa challenges Nick to play the following game: In each move, Nick can remove one integer from the top of

Network administration

Cerinta completa Time Limits C:5, Cpp:5, C#:6, Java:8, Php:18, Ruby:20, Python:20, Perl:18, Haskell:10, Scala:14, Javascript:20, Pascal:5 Like every IT company, the Uplink Corporation has its own network. But, unlike the rest of the companies around the world, Uplink’s network is

Median Updates

Cerinta completa The median of numbers is defined as the middle number after sorting them in order if is odd. Or it is the average of the middle two numbers if is even. You start with an empty number list.

Left Rotation

Cerinta completa A operation on a circular array shifts each of the array’s elements unit to the left. The elements that fall off the left end reappear at the right end. Given an integer , rotate the array that many

Equal Stacks

Cerinta completa You have three stacks of cylinders where each cylinder has the same diameter, but they may vary in height. You can change the height of a stack by removing and discarding its topmost cylinder any number of times.

Library Query

Cerinta completa A giant library has just been inaugurated this week. It can be modeled as a sequence of N consecutive shelves with each shelf having some number of books. Now, being the geek that you are, you thought of

Easy Addition

Cerinta completa You are given a tree with N nodes and each has a value associated with it. You are given Q queries, each of which is either an update or a retrieval operation. Initially all node values are zero.