title: What is a data structure that supports fast next-higher-element and next-lower-element?
body: <p>Specifically I want O(log n) insertion/deletion times and O(1) operation for find_next_higher_element which given an element in the data structure returns the element just greater than it in constant time. I don't know if this is even possible but my intuition tells me it is.</p>