Talk:Sort the letters of string in alphabetical order: Difference between revisions

For this task it is not necessary to perform a sort!
(For this task it is not necessary to perform a sort!)
Line 35:
 
: ASCII or EBCDIC are both completely immaterial. The task '''SPECIFICALLY''' states '''alphabetical''' (used to be alphabitical but whatever). In the alphabet, 'N' '''does not''' come before 'a' (as most of these example wrongly demonstrate). The task is stupid and should be removed. But if we insist on keeping it, the examples should at least follow the actual task title / description. '''Or''', the title / description should be changed to what the task is actually demonstrating. --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 13:13, 26 July 2021 (UTC)
 
::Not completely immaterial. An alphabet is an ordered set of symbols, which children learn during early learning. The task should specify the alphabet and its ordering. perhaps using a non-English alphabet such that not only the order of N n and a n have to be considered but also à á â ä æ ã å and there capitalized partners. I suggest 3 ways of ordering the symbols on a computer: 1) Form a bijection between the symbols and a subset of the set of integers, and sort the integers. ASCII and EBCDIC are such bijections, but may not produce the required result. 2) Write the alphabet as a list, given 2 symbols search through the list and return the one found first as the smaller. 3) Build the alphabet as a binary tree.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 14:44, 26 July 2021 (UTC)
==For this task it is not necessary to perform a sort!==
Given the alphabet as an ordered list of characters. Pass through the string once counting the number of occurrences of each character. Pass through the alphabet once outputting the corresponding character the appropriate number of times.--[[User:Nigel Galloway|Nigel Galloway]] ([[User talk:Nigel Galloway|talk]]) 14:44, 26 July 2021 (UTC)
 
== Slacksort ==
2,172

edits