473,394 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Selection sort algorithm using strcmp

I need hints for an algorithm using string compare in a selection sort.
I will be sorting lastnames and first namesalphbetically. if the selection sort encounters the same last name it then goes to first name and alphabetizes the list.

Smith, John
Smith, Juan



THANKS IN ADVANCE!!
Apr 23 '07 #1
1 4141
RedSon
5,000 Expert 4TB
I need hints for an algorithm using string compare in a selection sort.
I will be sorting lastnames and first namesalphbetically. if the selection sort encounters the same last name it then goes to first name and alphabetizes the list.

Smith, John
Smith, Juan



THANKS IN ADVANCE!!
What are you talking about? What kind of hints are you looking for. Its pretty straight forward, use string compare to do a selection sort. Do you know what the algorithm for selection sort looks like? Do you know how to use string compare functions?
Apr 23 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: JasBascom | last post by:
say i had 97456 and 23456 is there already a sort function to check which one begins with the smaller number rearrange it. in this case the bottom number should clearly be rearranged to the...
2
by: JasBascom | last post by:
I thought it was too much to put this program in with my last message. The program compiles ok, but when I execute, I get access errors. can someone put it through their compiler please. I think...
8
by: Les Coover | last post by:
I have tried writing the selection process after scanf many different ways. No matter what is selected program execution goes to the add_data function. How can I get this to work? /*...
48
by: Alex Chudnovsky | last post by:
I have come across with what appears to be a significant performance bug in ..NET 2.0 ArrayList.Sort method when compared with Array.Sort on the same data. Same data on the same CPU gets sorted a...
4
by: Hunk | last post by:
Hi I have a binary file which contains records sorted by Identifiers which are strings. The Identifiers are stored in ascending order. I would have to write a routine to give the record given...
0
Ganon11
by: Ganon11 | last post by:
Earlier, mmccarthy was kind enough to post a short article explaining the Bubble Sort. As she said, this is a relatively slow sorting algorithm. Here, I will attempt to present a slightly faster...
1
by: mosullivan | last post by:
I had to write a program that would accept 7 strings through scanf, list the strings, alphabetize, and relist. I was supposed to use strcmp to assist with the sort and write it so that it can sort...
7
by: mahdiahmadirad | last post by:
Hi dears! I wrote a simple bubble sort algorithm. it works properly when we compare full arrays but i want to sort a 2d array according to a specific part of array. it has some problem to swapping...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.