Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Delete elements from list..
Replies: 17   Last Post: Mar 8, 2011 5:37 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Maarten van der Burgt

Posts: 10
Registered: 5/7/10
Delete elements from list..
Posted: Feb 21, 2011 7:31 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hallo,

I have a list like:

mylist = {1, 2, 3, 4, 5, 6, 4, 5, 7, 8, 9}

I want to delete any element which is not strictly larger than the
previous element, until my new list has only increasing values.

This means in mylist above I want to delete the 4 and the 5 at position
7 and 8.

Any elegant and fast way for doing this?

In practice I want to do this for a large amount (1000) of very large
lists (1000). So speed is important.

Thanks for your help.

Maarten



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.