Tuesday, January 4, 2011
next in an array
Design a data structure to find the next higher element for each element in an array.
Subscribe to:
Post Comments (Atom)
Random commentary about Machine Learning, BigData, Spark, Deep Learning, C++, STL, Boost, Perl, Python, Algorithms, Problem Solving and Web Search
1 comment:
Precomputing all the solutions is O(n) words and O(1) access time. Scanning the array is O(1) space and O(n) access time. Do you want a tradeoff?
Reply Delete