[Edit]
From the feedback/answers I have received, I gather there is some confusion regarding the original question. Consequently, I have reduced the problem to its most rudimentary form
Here are the relevant facts of the problem:
- I have a sorted sequence: S
- I have an item (denoted by i) that is GUARANTEED to be contained in S
- I want a find() algorithm that returns an iterator (iter) that points to i
- After obtaining the iterator, I want to be able to iterate FORWARD (BACKWARD?) over the elements in S, starting FROM (and including) i
For my fellow C++ programmers who can also program in Python, what I am asking for, is the equivalent of:
const_iterator std::find (const key_type& x ) const;
The iterator returned can then be used to iterate the sequence. I am just trying to find (pun unintended), if there is a similar inbuilt algorithm in Python, to save me having to reinvent the wheel.