Dec 18, 2008

design a data structure, this data structure have four functions: pop, push

design a data structure, this data structure have four functions: pop, push
, min, top. DO NOT use any stack, queue, list, array or things like this.

Use hashtable, each entry records current value, current min and the key of next entry.
“Top” always record the first entry of the stack,
when pushing, generate the new entry and update the “top”
when popping, clean the top entry and update the “top”

No comments:

Post a Comment