Counting through linked lists?

How would you count through a linked list? I mean like for an array, you would just use a for loop to count through the array and then put whatever you want the script or function to do with the array. How would you do this for a linked list?

 Respuesta aceptada

Walter Roberson
Walter Roberson el 6 de Mzo. de 2013

0 votos

Start at list.root . Repeat {If the current list point is not the end of list, perform the action on list.value, and make list.next the current list point.}

Más respuestas (0)

Categorías

Más información sobre Matrices and Arrays en Centro de ayuda y File Exchange.

Preguntada:

Joe
el 6 de Mzo. de 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by