How to reverse the order of a list (nodes)

i can't figure out how to reverse the order of the values in a list of nodes. Could anyone help?
public class IntList
     public IntNode head;
     public IntList()
          head = null;
     public void reverse()
          // I don't know how to write this
}

read through the list from the end to the start, putting each element into a new list. then replace the original list with the new one.
lots of ways it can be done.
dont ask me which is more efficient. the stack suggestion sounds pretty good.

Similar Messages

  • Can't remember how to reverse the order of the tracks in a playlist ~ can anyone help  me out?  Thanks.

    Can't remember how to reverse the order of tracks in a playlist.....can anyone help me out?  Thanks.

    Were you able to figure it out?

  • Can I reverse the order of finder lists or icons?

    Hello,
    I am finding some problems with Lion that I never seemed to have with Snow Leopard and would very much appreciate someone's help.
    To cut a long story short I want to reverse the order of the files in finder, either in list or icon view (or maybe any kind of view). At the moment they are in date created order, but I have also tried in name order and cannot see any way to reverse the order.
    At present the are show the newest file first but I want to see them in oldest first as they always were for me in OSX 10.6
    Also... in date created view they appear in groups (eg previous 7 days, previous 30 days) I have never seen this before and find it particulalry annoying. I'm sure some people love it but for me it is one of the things that I most hated about windows, but at least in Windows I found it easy to turn off (along with reversing order!). Can anyone tell me how to stop OSX from doing this?
    Much obliged,
    Pablo

    Welcome to Apple Support Communities. We're users here and don't speak for "Apple, Inc."
    In Finder icon view, click the Arrange button and select which column you'd like to sort by.
    In Finder list view, click the top header of any column to sort by that column. Clicking the same header again reverses the sort order (and the small 'arrow' at the end of the column name reverses direction too).
    And using Finder, View, Customize Toolbar the Finder window toolbar can be customized to display icons only, text only or both, as well as adding additional icons to the default toolbar:
    Message was edited by: kostby

  • How to reverse the order of a bunch of still images in an iMovie Project

    Hello,
    I'm making a stop motion animation using iMovie'09. I need to reverse the order of a few hundred of the images that I imported.
    Does anybody know a good and time efficient way of doing this?
    Cheers,
    Onur.

    Ok, here's how have I done:
    1. Removed those images from the movie project
    2. Created a new project and added all the images which I want to reverse the order of
    3. Set the durations of the images as same as those in my first project
    4. Exported the project as a movie file
    5. Added this short movie file to the first project
    6. From clip adjustments menu, checked 'reverse'.
    There, the subset of the whole collection is displayed in the reverse order.
    Message was edited by: Onur

  • How to reverse the order of an OrderedMap?

    Is there a quick and efficient way to reverse the order of an OrderedMap?
    I'm sorta using an OrderedMap for 'breadcrumbs'. Traversing from a specific page, category by category all the way up to the top.
    For example:
    OrderedMap map = new LinkedMap();
    map.put( "Rabbit", "" );
    map.put( "Mammals", "/animals/mammals/index.jsp" );
    map.put( "Animals", "/animals/index.jsp" );
    Iterating it in my JSP view page, I get this order, which is wrong :
    Home >> Rabbit >> Mammals >> Animals
    Thats why I was wondering how I can reverse the order of the OrderedMap to get this:
    Home >> Animals >> Mammals >> Rabbit
    Thanks for reading.
    Regards,
    Stanley

    What about the following idea:
    you could write two wrapper classes:
    class ReverseOrderedMap implements OrderedMapand
    class ReverseOrderedMapIterator  implements OrderedMapIteratorIn these classes, you just map the methods
    firstKey -> lastKey
    lastKey -> firstKey
    nextKey -> previousKey
    next -> previous
    and so on. In this way, you just provide a "reversed view" on the original map.
    However, I'm not sure where elements added with put are ordered: Is it just in the sequence of addition? If yes, then the wrapped map behaves wrong, if new elements are added, because there is no corresponding "put at the begining" method. In this case, the wrapper should make the reversed map unmodifyable by implementing the put and putAll methods with throwing an exception.

  • Reverse the order of stacks list view

    Is there a way to reverse the order when viewing the contents of a stack in list view by date added?
    For example, the downloads stack: the default setting puts the most recently added at the top of the list, meaning I have to scroll up to it, rather than at the bottom, where it'd be right there above the icon to click on.
    Thanks for the help

    I completely agree with Solar Servant,
    The regular stacks view is viewable in this (very practical) direction, so why not the list variety?
    thanks for making a more usable OSX a reality

  • How do I reverse the order of file lists in finder?

    When I display a finder page with icons the sort is ascending (A-Z), but when I use the list function it is decending (Z-A).  How do I reverse the list order?

    Welcome to Apple Support Communities. We're users here and don't speak for "Apple, Inc."
    In Finder icon view, click the Arrange button and select which column you'd like to sort by.
    In Finder list view, click the top header of any column to sort by that column. Clicking the same header again reverses the sort order (and the small 'arrow' at the end of the column name reverses direction too).
    And using Finder, View, Customize Toolbar the Finder window toolbar can be customized to display icons only, text only or both, as well as adding additional icons to the default toolbar:
    Message was edited by: kostby

  • [q] how to understand the 'order' of a list?

    hi,everyone
    there's a test program:
    import java.util.*;
    public class testList
    void test()
    LinkedList ll= new LinkedList();
    ll.add("3");
    ll.add("1");
    ll.add("2");
    ll.add("5");
    ListIterator li = ll.listIterator();
    while (li.hasNext())
    System.out.println(li.next());
    public static void main(String[] args)
    testList tl = new testList();
    tl.test();
    As we know, order is the most important feature of a List.
    But this program's result is " 3 1 2 5 " which is not a sorted list!
    How we understand the phrase 'order' ?
    And , is there any method in Collection which can sort the elements in one collection (list or set)?
    thanx a lot!

    As we know, order is the most important feature of a
    List. Yes, and it preserves the order you have used to put elements in the List. :)
    But this program's result is " 3 1 2 5 " which is not
    a sorted list!Well, what order to you actually like? "1 2 3 5"? Why not "5 3 2 1"? And for more complicated objects "natural" order may be even less obvious. And never forget that List may contain objects that belong to different classes - for example Integer, String and Date - how they are to be ordered? (Of course, such usage is not recommended).
    How we understand the phrase 'order' ?
    And , is there any method in Collection which can
    sort the elements in one collection (list or set)?There are sort-methods in java.util.Collections class.

  • How to reverse clip order in FCP7 timeline?

    I'd like to reverse the order of clips in my FCP7 timeline  (NOT reversing each individual clip). I want to show some clips on the timeline and then immediatley play the same set of clips in reverse order (not each individual clip in reverse order).
    Is there a way to reverse the order of the clips in the FCP7 timeline?
    Thanks!

    In other words, Meg, you're saying you don't know of any way to do what I'm talking about?
    Of course I could manually place them in reverse order, one by one - but that's not what I asked about. I asked how to reverse the order of the clips.
    To suggest manually rearranging the order of the clips in reverse would be like if someone asked how to reverse the play direction of one clip, and someone were to reply with a suggestion of rearranging the individual frames, one by one, until reverse playback of the clip were achieved.
    Let me try to clarify for anyone else that may read this, to avoid further difficulty understanding what I'm saying....
    I want to know how to take a series of clips that are on a timeline (i.e. Clips A, B, C, D, E, F), and get them to be put in the opposite order on the timeline (i.e. Clips F, E, D, C, B, A).  I DO NOT WANT to manually rearrange the clips, NOR rearrange copies of the clips, NOR take the Clips from the bin and place them in reverse order on the timeline.
    The point to my query is to avoid the time-consuming effort of manually placing clips in reverse order, if there is a way to do this (just like instead of taking a clip and painstakingly copy/paste each frame, one-by-one, in the opposite order of its natural way, you just Modify the Speed to Reverse).
    Make sense?

  • How do I reverse the order of photos/years in osx

    with the new OS X photos software it shows the most recent year at the bottom of my screen. How do I reverse the order so the most recent year is at the top. Thank you

    You can't at this time. Send a feature request to Apple.  You can use this feedback form:
    Apple - Mac OS X - Feedback

  • How can I reverse the order of podcasts so I can listen in cronological order

    How can I reverse the order of podcasts so I can listen in cronological order!

    What I did was create a playlist for the podcasts and keep it sorted in reverse date order, which puts the oldest first. To prevent it from automatically playing the next podcast, I actually mark all podcasts as "skip when shuffling", and then play in shuffle mode. I also make sure all my podcasts have a genre of "podcast"; I discovered that if you use media type, the playlist doesn't update correctly on the iPod classic
    So, what I've got is a playlist of the form: (play count = 0) and (genre = podcast), sorted in reverse date order.

  • Reverse the order of elements in an array

    how would i go about Reverse the order of elements in an array??

    I link to the javadocs can't be too bad. [url
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Coll
    >
    ections.html#reverse(java.util.List)]Collections.rever
    se(List)Of course I fortell the next question, but I wantan
    Array not a List? So I provide the next link:[url
    http://java.sun.com/j2se/1.5.0/docs/api/java/util/Arr
    ys.html#asList(T...)]Arrays.asList(T...)Yeah but then you have to worry about the next
    question which is more of a statement: "I can't use
    Arrays".
    Then I would as them: How would you do it in real life? Of course they could think a real world way of doing it. In that case, I'll give them an real life example.
    Assumed List
    1 2 3 4 5 6 7 8 9 10 11 12 13
    Switch the first and the last elements
    13 2 3 4 5 6 7 8 9 10 11 12 1
    Then the second and second to the last
    13 12 3 4 5 6 7 8 9 10 11 2 1
    And repeat until your half way.
    13 12 10 4 5 6 7 8 9 3 2 1
    13 12 10 9 5 6 7 8 4 3 2 1
    13 12 10 9 8 6 7 5 4 3 2 1
    13 12 10 9 8 7 6 5 4 3 2 1
    Done.

  • How to change the order of users in appearance of login screen?

    Hello!
    Because we often switch to a user,
    which is listed last in login screen,
    we want move them to the second place.
    How to change the order of users in appearance of login screen?
    Thank you for a tip
    Erhy

    The order users show up on the login screen is the way they are ordered under the
    C:/Users directory. This is usually alphabetical, AFAIK there is no other way to change the order other than to change the username to something that starts with a letter that will be higher alphabetically.

  • How to reverse the Reconcile Sub Contract Challan.

    Dear Expert,
    How to reverse the Reconcile sub Contract Chaaln. Our user has been made wrong GR and reconcile the Challan Number aganist same GR Number.After check the Report J1IFR then shown wrong entry.
    Please revert to me as soon as possible.

    Tried this step.
    The mat doc no has been removed from the list (as seen in J1IFR) But the qty is still the same. Even qty has to be reducedto reconcile the correct mat doc
    pl help

  • How to reverse Internal Order Settlement Postings

    Dear Sir,
    We have settled cost of an Internal Order to another Internal Order using Tcode KO88 . Due to some mistake , we want to reverse the posted settlement transactions .
    Pl guide us , how can we reverse the same .
    Regards
    B Mittal

    I had execute ko88 in period 3, for internal order type tools,
    now I wont to reverse settlement but in period 4,
    period 3 is closed.
    can I reverse the order with ko88, then with kb21n repost the order for tool to the new one investment order.
    now I have also problem with direct activity allocation, I need first reverse direct act all on old order and post it on new type order.
    is this process ok=?

Maybe you are looking for

  • Confiemed qty in Afru table

    Hi expert    How to get the cancelled operations in the afru table    since i need to calculate the confirmed qty Regards

  • Error in the ABAP code

    Hello all, I am getting error in ABAP code . The error is:Field "0" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. I have statement as calmonth = sy-datum + 0(6). Any ideas are always welcome Thanks, JB

  • Third-party Lightroom 5 Book Templates: Where to find

    Hi all, I love the book module in Lightroom 5.  I made a 240 page photobook last year and am working another one now. For the me the great value is being able to link the source raw files directly into the book pages and to maintain full image contro

  • Fill dinamic internal table from internal table

    Hi gurus i need to know how can i fill a dinamic interna table from another internal table example i have  the table called it_info with the followin information field1    field2         field3 Alex     Ross           1 Rita      Campos       1 becau

  • Quicktime 7.7.4 locking Firefox Windows 8.1 pro preview

    My own website has on the index page an embedded music file. Until recently this feature played very nicely, however after reloading all the plugins after installing the Win 8.1 preview and then Quicktime my front page locks up about 90% of the time.