473,406 Members | 2,439 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,406 software developers and data experts.

Sort numbers

How do I sort five numbers? and what library should I include?
Oct 7 '07 #1
8 1788
Ganon11
3,652 Expert 2GB
There are several sorting methods you could use - some are described in the Articles section.
Oct 7 '07 #2
There are several sorting methods you could use - some are described in the Articles section.
Can you please describe one for me, I tried to look into the articles but I couldn't find one.
Oct 7 '07 #3
oler1s
671 Expert 512MB
I tried to look into the articles but I couldn't find one.
You may want to revise your claims of effort. See, when I click on the C/C++ Articles link I see two articles on bubble sort, and selection sort, on the first page, and above the fold. Or when I do a Google search, I get bazillions of results, or when I look at Wikipedia, I get code right there for sorting.

Given that it takes five seconds to do a Google search, laziness is never rewarded on programmer forums.
Oct 7 '07 #4
You may want to revise your claims of effort. See, when I click on the C/C++ Articles link I see two articles on bubble sort, and selection sort, on the first page, and above the fold. Or when I do a Google search, I get bazillions of results, or when I look at Wikipedia, I get code right there for sorting.

Given that it takes five seconds to do a Google search, laziness is never rewarded on programmer forums.
I know thanks for your help, I looked at all of those before I posted this question, I am a new programmer, I just started 3 weeks ago. I looked at wikipedia, I tried to do it like that, but it didn't work.
But anyway thank you for helping!
Oct 7 '07 #5
oler1s
671 Expert 512MB
So if you found the resources that show you how to sort numbers, why ask that question to us? Shouldn't your main concern then be getting one of them to work? Can you get bubblesort to work? And if you are having trouble with that, why not request our assistance on that issue?
Oct 7 '07 #6
So if you found the resources that show you how to sort numbers, why ask that question to us? Shouldn't your main concern then be getting one of them to work? Can you get bubblesort to work? And if you are having trouble with that, why not request our assistance on that issue?
I guess that, that's what I sould've done. What library do I use for bubblesort?
Oct 7 '07 #7
Ganon11
3,652 Expert 2GB
You don't use a library, you have to write the function yourself. It really isn't that hard.
Oct 7 '07 #8
Shashi Sadasivan
1,435 Expert 1GB
Hi,
You wouldnt need any special library for doing a bubble sort.
its just a sequence of a few for loops.
the pseudo code will be very well explained on most of the articles on the internet
or like this thread

If you do get stuck with understanding how to implement it from pseudocodee to actual code... guess its back to the book with syntax;s

if you do face issues otherwise, please specify the issue.

cheers
Oct 7 '07 #9

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

Similar topics

15
by: David | last post by:
sorry for the last post, itchy fingers. I'm having a bit of difficulty sorting images named in sequential numerical order. Here are the image names and how I need them sorted. image1.jpg...
1
by: strotee | last post by:
#include <iostream> #include <ctime> using namespace std; // function declarations void swap(int *a, int *b); void sort(int arr, int beg, int end); int main() {
19
by: David | last post by:
Hi all, A while back I asked how to sort an array of strings which would have numerals and I wanted to put them in sequential numerical order. For example: myArray = "file1"; myArray =...
11
by: Leon | last post by:
I have six textbox controls on my webform that allows the user to enter any numbers from 1 to 25 in any order. However, I would like to sort those numbers from least to greatest before sending them...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
4
by: Tony WONG | last post by:
i have a number of forms with fax numbers to come up into arrays and then combine to string. after that i design the flow 1. break the string to array now the string looks like this...
7
by: ^cypis^ vel. SQ9JTI | last post by:
Hi, i need your help. I have to prepare a homework, easy program, which will be sorting the values from txt file and writing the solution to another txt file. It has to be a bucket sort. Have...
75
by: At_sea_with_C | last post by:
Hello all, I have written an ascending sort routine for floats. This seems to do the job, but for elements over 10,000, it gets awfully slow. A lot of useless comparisions with previously sorted...
2
MMcCarthy
by: MMcCarthy | last post by:
The Bubble Sort is a very slow algorithm but it is one of the simplest which is why it is often used to introduce students to the concept of sorting. Imagine you are looking at numbers on a...
9
by: mosullivan | last post by:
I can't figure out how to print after every pass through the bubble sort. I'm supposed to display the sort after every pass through the loop. Below is what I have so far. #include <stdio.h>...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.