Quantcast
Channel: Cadence Custom IC Skill Forum
Viewing all articles
Browse latest Browse all 5067

circular traversing list

$
0
0

Hi,

Is there an efficient way of implementing push functionality on a list (== circular traversing == removing last element and appending to the beginning of the list || removing first element and adding to the end of the list)?

List elements are not uniq. List can be very long, so I am searching for an efficient way.

I tried such implementation and it seems to be fine, just not sure, if the most efficient.

searchQueue1=lconc( nil list(1 2 3 4 5 6 7 8 9 ))

cadr(tconc(searchQueue1 popf(car(searchQueue1))))

and to reverse order:

searchQueue1=lconc(nil reverse(car(searchQueue1)))

cadr(tconc(searchQueue1 popf(car(searchQueue1))))

Please let me know, if there is a more efficient way of doing the same.

Thanks and best regards

Blaz


Viewing all articles
Browse latest Browse all 5067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>