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

m
Line 38:
::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)
 
::: <pedantic-mode: on;> '''COMPLETELY''' immaterial. Neither is an alphabet. True, the task doesn't specify which alphabet to use, but neither of those are one. As for not using a sort, the task '''specifically requires''' writing a routine to '''sort'''. In what way could you interpret that to mean you don't need to sort? Yes, yes, I agree, you don't need to sort to get the end result required by the task, but it is pretty clear "Write a sort methodfunction, don't just use a built-in" requires there to be some kind of sort involved. <pedantic-mode: off;> --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 14:59, 26 July 2021 (UTC)
 
==For this task it is not necessary to perform a sort!==
10,333

edits