Alphabetizing help

Hello yet again,
For my computer science class, we need to write a program that alphabetizes a list using a selection sort method.
Is there a way to quickly alphabetize the elements without creating a million if statements?
I have created code to put each word into an arraylist as a seperate string.
Any help on this topic would be greatly appreciated.

CliffSniper wrote:
yes, I have seen that page
however, i'm asking for algorithm helpThat page describes the algorithm. I'm sure you can google for selection sort and find other examples and explanations. If you don't understand some part of it, ask a specific question.
right now, im thinking about assigning each letter of the alphabet a value and sorting the words based on their number value of the first char. Obviously, this is a very repetitive coding task and probably not the most efficient. Is there any specific algorithm for letter alpahbetization?If you're sorting words, you can use String's compareTo method to determine which word is "less than" the other.

Similar Messages

  • Alphabetical Help Index

    Is there an alphabetical HELP index somewhere in Audition CS5.5?  Like those in PhotoShop and othere Adobe applications?  It's a pain having to dig through the sections trying to find information and the Search doesn't always bring up the information I need.
    I've just upgraded my Master Collection to CS5.5 and have to learn Audition quickly - it's very different from SoundBooth and most of the YouTube tutorials focus on Audition 3.0
    Any hints about how I can make this move more quickly and smootly?
    Many thanks!

    Although there are some features missing from AA CS5.5 compared to AA3 most of the basic operations are similar. So a video tutorial on AA3 may very well be enough to get you started with CS5.5.
    You might find the online help easier to navigate than the built in one.
    http://help.adobe.com/en_US/audition/cs/using/index.html

  • Wrong order on cd after burning

    for some reason, the playlist that i have is not burning in the same order onto a cd... the songs have numbers on them and i made sure that i clicked the album order in the playlist.. but it still burns in the wrong order... alphabetically
    help? please

    I went into INFO & added 01, 02 at the beginning of each title.
    I burned the CD.
    It looks like it's out of order, but it seems to play in the order I chose.
    I printed the CD insert in the order I wanted, and the guy I'm giving the CD to can put them in the order I chose.
    This should be easier than it is. Esp. when giving a gift CD, the order of the songs is important. I don't know why there are several questions on this site with the same problem. APPLE - make it easier.

  • Lion upgrade removed users

    I upgrade my 2008 imac from Snow Leopard. I have 7 user accounts (2 admin, 1 normal, 4 managed) and 5 of them (1 admin, 1 normal, 3 managed) were deleted when I upgraded to Lion. (The home directories were still there, but the accounts needed to be re-created. The only clue that I have is that the 2 accounts that were not deleted were the first two alphabetically.

    HELP! Install deleted my admin account!  When I try to get support, it says I can't get support for my BRAND NEW system software because my hardware is too old!

  • Can you tell me how I can ask for help with the following Indesign question:  I am a new Indesign user and a Creative Cloud member.  I was using the Window/Pages drop down window to view my pages alphabetically or by page number and also to determine whet

    I am a new Indesign user and a Creative Cloud member.  I was using the Window/Pages drop down window to view my pages alphabetically or by page number and also to determine whether or not my JPEG files were sufficiently HI-Res for the printer.  I don't know how I did it but somehow the window has changed so that now it does not have the alphabetical/numerical/Hi-Res information.  It just shows the pages in a two page spread in numerical order.  How can I restore the window so that I will be able to view the information as I did previously.
    Your help will be appreciated,
    Don Unwin
    [Personal Information Removed]

    The pages panel is not the place where you see this information.  You can customize the Links panel to show all sorts of things, including the page number, effective and actual ppi, and whether the link is OK or needs updating.

  • Help with using mergesort to sort a list of names alphabetically?

    Hi, I'm trying to sort a list of names alphabetically, case-insensitive by using the mergesort technique.
    I wrote this code and when I trace it through on paper with an example array of names, it should work, but when I run it with an actual txt file, it's not correctly alphabetical.
    I'd appreciate it if someone could take a look at my code and give me some ideas on what my problem might be.
    Thanks in advance! (note: I also posted this question to java-forums.org, as I've been working on this little problem for over five hours and am in desperate need of some help!)
    public static void mergeSort(String[] names) 
            if (names.length >= 2) 
                String[] left = new String[names.length/2]; 
                String[] right = new String[names.length-names.length/2]; 
                for (int i = 0; i < left.length; i++) 
                    left[i] = names;
    for (int i = 0; i < right.length; i++)
    right[i] = names[i + names.length/2];
    mergeSort(left);
    mergeSort(right);
    merge(names, left, right);
    // pre : result is empty; list1 is sorted; list2 is sorted
    // post: result contains result of merging sorted lists;
    // add merge method below
    public static void merge(String[] names, String[] left, String[] right)
    int i1 = 0;
    int i2 = 0;
    for (int i = 0; i < names.length; i++)
    if (i2 >= right.length || (i1 < left.length && left[i1].compareToIgnoreCase(right[i1])<0))
    names[i] = left[i1];
    i1++;
    } else
    names[i] = right[i2];
    i2++;

    Welcome to the forum.
    Please read this to learn hot to format your code (and other things relevant for this forum):
    https://forums.oracle.com/forums/ann.jspa?annID=1535
    923566 wrote:
    Hi, I'm trying to sort a list of names alphabetically, case-insensitive by using the mergesort technique.
    I wrote this codeDo you know the <tt>TreeSet</tt> class?
    http://docs.oracle.com/javase/7/docs/api/java/util/TreeSet.html
    With that sorting Strings is a two liner:
    http://www.java2s.com/Code/Java/Collections-Data-Structure/TreeSetDemo.htm
    bye
    TPD

  • Help needed in Sorting Columns (date sorts alphabetically)

    Hi All,
    I have a report query as follows:
    select to_date(period,'MON-YYYY') start_date
    ,exp_type
    ,id
    ,acct_ref
    ,dept_ref
    ,item_date
    ,amt
    from test;
    I need to display the report in the same order as select statement (start_date,exp_type,id etc). I have given default sort order in report attributes and user enabled sort on all columns. The report attributes look as shown below:
    column_name / sort / sort_seq
    start_date / yes / 3
    exp_type / yes / 1
    id / yes / -
    acct_ref / yes / -
    dept_ref / yes / 2
    item_date / yes / 4
    Now my problem is that the start date sorts alphabetically (as varchar) instead of chronologically (date wise). How can I resolve this?
    If I change my default sort order so that start_date is sorted 1st, it works perfectly fine. Is there any restriction for APEX sort that says the column displayed needs to be sorted in the same order? How do I overcome it? Or is it possible to overcome it?
    Any suggestions would be appreciated.
    Thanks,
    Sumana

    Hi,
    Thanks. But no I cannot change it to date, as there are many applications using it for displaying the period. But I found an equivalent date column for that period and tried using that. It was not working.
    I did further analysis and found that even to_char(period) works fine. The problem was something else. In my region query the select statement was
    select exp_type
    ,id
    ,amt
    ,to_date(period,'MON-YYYY')
    from test.
    I then had in region attributes used the arrows to change order of display, so that period appears first. That was the culprit. When I change my region query, to match the order in region attributes the date column as well as to_date(period) both work fine.
    I never knew that the order of select statement and that in region attributes should match each other!!! And hence when posting I did not give importance to the order of my select list. Sorry for that.
    The mystery is how was it working when i changed the sort order to say "period" 1st and then exp_type (2nd)
    Thanks everyone for you help.
    Thanks,
    Sumana

  • Up until this latest upgrade to iTunes, all my tv shows were listing in episode sequential order on my iPod.  Now they are only showing up in alphabetical order.  Help?

    I loved my iPod Classic because I would load a television series on it and be able to watch it in Episode Sequential order.  But since this latest update to iTunes, all my television files (while staying seasonally organized) are now listing alphabetically.  Help?  Ideas? Explanation?

    add your release date manually if it isn't there.
    unfortunatly iTunes won't let you do it. i use a program called "TvTagger". just search google, third result from top, that's the one. you have to enter a release date like this: YYYY-mm-dd . I did it and I think it's worth the hassle. not only are your shows sorted correct, but the ugly "Unknown Release Date" line is replaced by the actual release date

  • Some albums are being listed before compilations instead of alphabetical order. Please help

    I have a few albums that are being listed after 'Z' alphabetically and before the compilation section rather than being listed alphabetically. Is there any way to fix this? I like to have my albums listed alphabetically and not scattered to the bottom. I have attached a picture that shows this problem (It starts with Josh Groban and goes to the Miley Cyrus song). Any help would be great! Thanks!

    Bumping for help

  • I want to make a CD that is NOT in alphabetical order, not in artist alphabetical order and not in album alphabetical order... I want to make it the order I want.  Can this be done? How?  thanks in advance for all your help.  Mona

    I want to make a CD that is NOT in alphabetical order, not in artist alphabetical order and not in album alphabetical order... I want to make it the order I want.  Can this be done? How?  thanks in advance for all your help.  Mona

    cjam732 wrote:
    Ed - by sequence of numbers, are you talking about the rectangle with the arrow that sorts by track number?  I've tried to follow your directions to Mona but my playlist still gets burned to CD in alpha order.  driving me crazy.  any other suggestions?   thanks, Chris
    Chris, The sequence number is the first column of numbers, to the left of the Name column.  It always goes 1, 2,3  etc.  It is not the same as the Track Number, which has its own column.
    As a precaution before burning, make sure that Shuffle is tunred off, and that you right-click the playlist name and choose 'Copy to Play Order"  (although technically they should not affect the burn).

  • Help !!! - Search using english base alphabet for French diacritic/accent

    Hello -
    I am searching using wild card in Oracle 9i database, as follows -
    select * from test
    where Upper(name) like 'A%'.
    It returns all the names upper and lower beginning with 'A'.
    We do have french data and few of the names begin with Á,Ä and à.
    In order to fetch all of the rows based on the base letter ,ignoring diacritic in the above same query,
    I have tried couple of settings as follows before executing the query -
    ALTER SESSION SET NLS_SORT='FRENCH';
    Or
    ALTER SESSION SET NLS_COMP=ANSI;
    ALTER SESSION SET NLS_SORT=GENERIC_BASELETTER;
    It didnot work. After reading the documentation, I have tried the query, for equality (=) search with some test data and seems to be working...
    So my guess is these settings are only useful if you have same exact name(data) for french as well english. Wildcard search '%' 'like' cases donot work.
    It would be really great if someone knows work-around for the query I have mentioned -
    select * from test
    where Upper(name) like 'A%'.
    to do get all the rows based on generic base letter ignoring those accents/diacritic.
    Or is there any other way we can implement this.
    I need to implement the generic solution for all english alphabets search in our application.
    ANY HELP would be REALLY APPRECIATED....
    Thank you so much....
    Rama...

    Hi Rama,
    For all current versions of the Oracle database, NLS_COMP=ANSI affects the following SQL operators only:
    WHERE =,WHERE >,WHERE <, START WITH, IN/OUT, BETWEEN, CASE WHEN, HAVING, ORDER BY.
    All other operators, such as LIKE, perform comparisons in binary mode only. They do not honor the NLS_SORT value. I hope that explains why you are seeing the behaviour that you described.
    This will be enhanced in 10gR2, where all SQL functions and operators will be able to honor the NLS_SORT value.
    You may be able to use the workaround below, if all your LIKE operations place the '%' at the end.
    e.g.
    ALTER SESSION SET NLS_SORT=GENERIC_BASELETTER;
    SELECT * FROM test
    WHERE NLSSORT (name,1,1) = NLSSORT('A');
    name
    Älex
    andrew
    Ace
    àlan
    Good luck!
    Nat

  • I can not get my itunes to sort my library in alphabetical order by artist??  Nor can I get the listing to be numbered...ie...1...2...3...4...5 etc.....Can anyone help??  It used to alphabetize my list correctly before I downloaded the 11.0.1 or 11.0.5

    I can not get my itunes to sort my library in alphabetical order by artist??  Nor can I get the listing to be numbered...ie...1...2...3...4...5 etc.....Can anyone help??  It used to be able to alphabetize my list correctly before I downloaded the 11.0.1 or 11.0.5 version of itunes?????

    How are you viewing your library? In Song view or Album View?
    If in Album view pull down View > Show View Options and select Sort by: Artist, then: (whichever choice you want here).
    If in Song view I like to see the album artwork so pull down View > Show View Options and select "show album artwork" and close the small window. Then click on the column that contains the artwork and sort it by Artist.

  • My music is in alphabetical order but doesn't show the letter headings or the letters on the side. Can anyone help?

    I just synced my Iphone to my new computer and added new music but the music doesn't show up like it used to. It doesn't have the letter headings or the letters going down the side. I have 21 songs right now and they are in alphabetical order but are shown like a playlist rather than a library.

    You do not have enough music to display the letters on the side. The phone needs more music for it to determine you need help going through the alphabet. I saw it written somewhere some time ago, and it does the same thing for Contacts. I believe it takes somewhere between 50-100 entries before it will display that letter side on the right side.

  • I don't know how to put in alphabetical order my mailboxes. Can you help me please?

    I don't know how to put in alphabetical order my mailboxes. Can you help me please?

    Try to force it into recovery mode to restore it, as explained here: http://support.apple.com/kb/ht1808.

  • Photos. They are on my macBook, backed up on time machine. Copied them (hours and hours) to external hard drive. They are now in alphabetical order (19,000  of them) NOT IN THEIR EVENTS or date order-and have been taken with different cameras- help!!!!!!

    Photos.
    They are on my macBook, backed up on time machine. There are 19,000+ of them, some rescued from a pc crash- which I used the nifty iPhoto to put back into date order.    
    I want to take them all off my laptop, now............as I need to use it for WORK!!
    Copied them (hours and hours) to another external hard drive.
    They are now in alphabetical order (all 19,000+ of them) NOT IN THEIR EVENTS or date order. (-They have also been taken with different cameras over the years and some of the generic camera numbering remains.)
    I have tried to copy them (only a few as an experiment)  one event at a time, but that again "opens up" the Event "folder" and tips them out as individuals and therefore just lists image letters and numbers alphabetically.
    How can I copy
    the whole library still in  "Events" to an external hard drive?
    the folders/albums I have already made on to this hard drive?
    and how can I add to this back up monthly, again keeping events and folders separate and updated?
    Mac is so user friendly - there must be a way.........
    Thanks

    UPDATE : I have re-installed from disk, various apps that were no longer functioning such as iLife, iWork etc. So, I now can access my photos again.
    Also, I had to re-install all the software for my printer ( Stylus Pro 4880 ) and reset it so the printer is working again.
    Photoshop CS4 won't open. I think I will have to get in touch with Adobe as basically, I guess they have a built-in "blocker" which prevents me from opening the app as the license is for only 1 user and having re-installed the OS, there are now, in effect, 2 users ( Me and Me 1, I think ).
    So, having added on a new external HD, Time Machine has made a copy of most of the files, folders, apps etc onto the external HD. The internal HD is still nearly full ( 220 GBs out of 232 GBs ).
    I am guessing the way to go now in order to free up space on the internal HD is to delete/trash older photos from my iPhoto library and hope that if needed, I will be able to access them on the external HD.
    Am I correct ? Please advise before I do something I will regret.
    Thanks, Sean.

Maybe you are looking for

  • How to connect my access database using applet?

    hi all, i need to connect my access database in my applet program which should work like an atm machine..I dont know how to connect it. Im new to applet same thing in JDBC application. Please help i terribly need it, our deadline in our case study is

  • Newbie question about entity and view objects

    Hi everyone, My first ADF application in JDeveloper is off to a difficult start. Having come from a forms background, I know that it is necessary avoid using post-query type lookups in order to have full filtering using F11/Ctrl+F11. This means creat

  • [Forum FAQ] How do I add an average line to series group on SQL Server Reporting Services column chart?

    Introduction In SQL Server Reporting Service (SSRS), you may need an average value on column chart. For the above chart, add an average score line to the chart, you can get which student's score is larger than average score, and which student's score

  • Get InputStream from file on disk?

    I have used this for some time now, with: InputStream realData = getClass().getClassLoader().getResourceAsStream(filename);But when I supply the full path 'realData' is null. It only works if the file is located in the resources folder under my proje

  • How to Call Function from SAPSCRIPT

    I want to Call a function from my SAPSCRIPT to get some data and print the same in the form , Can I get an example for this