How do you removing a cycle of integers (e.g. 1-2-3-1) from an array

Posted by Cheryl on Stack Overflow See other posts from Stack Overflow or by Cheryl
Published on 2010-03-29T05:29:00Z Indexed on 2010/03/29 5:33 UTC
Read the original article Hit count: 212

Filed under:
|
|

If you have an array of integers, such as 1 2 5 4 3 2 1 5 9 What is the best way in C, to remove cycles of integers from an array. i.e. above, 1-2-5-4-3-2-1 is a cycle and should be removed to be left with just 1 5 9.

How can I do this? Thanks!!

© Stack Overflow or respective owner

Related posts about c

    Related posts about arrays