c++ - Determining order of traversal of a sequence -


i have list of elements 1 30 in ascending order. list may or may not contain 30 elements. can start traversing list point , once reach end, can jump , resume traversal other end, i.e. along lines of circular queue.

given 2 consecutive elements (by position, may or may not value), possible determine direction of traversal, i.e. beginning end, or other way?

note: don't have access list's indices , given values @ instant.

i can 3 values, not two.

no, it's not possible determine direction of traversal given 2 elements. conditions allow following list: [1, 30].

you're given 2 consecutive elements: 1, 30. did start @ 1 travel right reach 30, or did travel left , wrap around reach 30? it's impossible tell.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -