Linear Algorithm
We put some algorithms on linear collection into tango.linear.*.
To use linear collection type, please go to tango.type.Stack, tango.type.LinkedList...
A overview of time complexity is listed below:
| Call | Time Complexity |
|---|---|
validPopStackSeries |
|
medianMaintenence |
validPopStackSeries(push: [], pop: []): bool
Returns true iff we can get the pop series from the push series, using a stack.
medianMaintenence(arr): []
For each time we visit arr from to ,
we maintenence the median of all elements from input,
and push this median into output array.