Sorting algorithms/Tree sort on a linked list: Difference between revisions

no edit summary
No edit summary
Line 11:
 
=={{header|J}}==
{{incorrect|J}}
 
What *is* a sentence in Finnegan's Wake? Let's say that it's all the text leading up to a period, question mark or exclamation point if (and only if) the character is followed by a space or newline. (There are some practical difficulties here - this means, for example, that the first sentence of a chapter includes the chapter heading - but it's good enough for now.)
 
Line 97:
 
=={{header|Kotlin}}==
{{incorrect|Kotlin}}
As I can't be bothered to download Finnegan's Wake and deal with the ensuing uncertainties, I've contented myself by following a similar approach to the Racket and Scheme entries:
<lang scala>// version 1.1.51
Line 151 ⟶ 152:
 
=={{header|Racket}}==
{{incorrect|Racket}}
{{trans|Scheme}} -- this implementation illustrates differences in identifiers and syntaxes of Scheme and Racket's <code>match-lambda</code> family. [http://docs.racket-lang.org/reference/match.html <code>racket/match</code> documented here].
 
Line 188 ⟶ 190:
 
=={{header|Scheme}}==
{{incorrect|Scheme}}
The following implements a sorting algorithm that takes a linked list, puts each key into an unbalanced binary tree and returns an in-order traversal of the tree.
{{libheader|Matchable}}
{{incorrect|Matchable}}
{{works with|Chicken Scheme}}
<lang Scheme>(use matchable)
Line 226 ⟶ 230:
 
=={{header|zkl}}==
{{incorrect|zkl}}
This code reads a file [of source code] line by line, and builds a binary tree of the first word of each line. Then prints the sorted list.
<lang zkl>class Node{
Anonymous user