简体   繁体   中英

How can I get the position of node from end in linked list

In single linked list such as (11 12 13 14 15). If I want to get position of node "15", it should be 0 and 14 should be 1 and so on. How can I do this? The method for this is public in positionOflast()

使用descendingIterator()方法并循环n 次,其中n 是索引。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM