LL Nth

LL_Nth(LL, n)

Returns the «n»th item in the linked list «LL», or returns Null when «LL» has fewer than «n» items.

This is a slow operation, which requires «n» steps to complete, since it must walk the linked list. Once you have finished collecting items, it is better to convert the linked list to an array using LL_To_RArray or LL_To_Array before using the collection. Once you've converted to an array, then random access into the array can be done in constant time using Slice or Subscript.

To use this function, you must add the Linked list library to your model.


Linked list library (Linked List Library.ana)

Use FileAdd Library... to add this library

See Also


You are not allowed to post comments.