Alphabetical order
Solved
sbbs
Posted messages
10
Registration date
Status
Membre
-
sbbs Posted messages 10 Registration date Status Membre -
sbbs Posted messages 10 Registration date Status Membre -
Hello!
I'm trying to do some research on alphabetical sorting, but I haven't found anything yet! Does anyone know of a website that could be useful for me?
Thank you!
I'm trying to do some research on alphabetical sorting, but I haven't found anything yet! Does anyone know of a website that could be useful for me?
Thank you!
6 réponses
It's to have in the table a character of your name per box so you just have to compare the same column number of each word, for example, the character in the 5th position of word1 tab[1][5] you can compare it with the character in the 5th position of word2 tab[2][5] and so on, and you shift if the character is greater.
No worries ^^.
For sorting, you need to compare letter by letter the first name with the second one. At first, if the letters are equal, you move on to the next letter, and as soon as they differ, you compare which one is closer to the beginning of the alphabet. If the second name is further down in the alphabet, you keep name 1 and replace it with name 2, and so on. Sorry, I haven't done this in a while, so I need to get back into it a bit, lol.
For sorting, you need to compare letter by letter the first name with the second one. At first, if the letters are equal, you move on to the next letter, and as soon as they differ, you compare which one is closer to the beginning of the alphabet. If the second name is further down in the alphabet, you keep name 1 and replace it with name 2, and so on. Sorry, I haven't done this in a while, so I need to get back into it a bit, lol.
Hello.
Can you help me solve this problem:
Write a function that finds the index of the smallest element in an array between two given indices. For example, we could look for the index of the smallest element in an array between index 5 and index 8.
I would like to compare your solution with mine.
Thank you.
Can you help me solve this problem:
Write a function that finds the index of the smallest element in an array between two given indices. For example, we could look for the index of the smallest element in an array between index 5 and index 8.
I would like to compare your solution with mine.
Thank you.
So there are 2 ways:
- either you test the name of each element letter by letter and move the elements as you go
- or you compare using ASCII code and move the elements.
you need to use arrays to do this. If you want more details, you need to tell me more.
- either you test the name of each element letter by letter and move the elements as you go
- or you compare using ASCII code and move the elements.
you need to use arrays to do this. If you want more details, you need to tell me more.
Hi.
I need examples of alphabetical sorting algorithms (sorting words in an array) or other cases!!
Thank you.
I need examples of alphabetical sorting algorithms (sorting words in an array) or other cases!!
Thank you.
If I understood your thing correctly, it's something like:
//enter names
while rep="o" and i<=10 repeat
Display("Enter a name and end with 0")
while tab[i][j]!=0 and j<=20 repeat
enter tab[i][j]
j <- j+1
End while
i <- i+1
nb <- nb+1
Display(do you want to enter another name?)
Enter(rep)
end while
//sort
j<- 1
For i from 1 to nb repeat
For j from 1 to 20 repeat
and then you create a variable to hold the name that you are going to overwrite when you move for the sorting
//enter names
while rep="o" and i<=10 repeat
Display("Enter a name and end with 0")
while tab[i][j]!=0 and j<=20 repeat
enter tab[i][j]
j <- j+1
End while
i <- i+1
nb <- nb+1
Display(do you want to enter another name?)
Enter(rep)
end while
//sort
j<- 1
For i from 1 to nb repeat
For j from 1 to 20 repeat
and then you create a variable to hold the name that you are going to overwrite when you move for the sorting
excuse me but I'm a beginner, I still need a helping hand :)
I can use selection sort or bubble sort!! you suggested bubble sort! can you clarify this point for me again??
I’m making an effort but I still need your help!
thank you