🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #78

Re: AVL tree insertion - programming exercise

#78
From: bart
Date: Fri, 09 Oct 2026 10:43
60 lines
4399 bytes
On 09/10/2026 09:34, David Brown wrote:
> On 09/10/2026 08:53, Tim Rentsch wrote:
>> BGB <cr88192@gmail.com> writes:
>>
>>> On 10/8/2026 7:56 AM, Tim Rentsch wrote:
>>
>>>> I learned about AVL trees from The Art of Computer Proggramming,
>>>> by Knuth.  I'm sure there are other explanations available but I
>>>> don't have any other pointers to give you.
>>>
>>> I read about them at some point when I was younger, and used them
>>> occasionally. [...]
>>
>> I encourage you to read the description in Knuth TAOCP.
> 
> I would not recommend that, any more than I would recommend "The C 
> Programming Language" to someone wanting to learn C.
> 
> Knuth's detailed mathematical treatment of algorithms is second to none, 
> and his contribution to computer science is legendary.  His writing 
> style is wonderful, and I thoroughly enjoyed the TeXbook (though it left 
> me with a serious disability - I am now unable to read text without 
> being annoyed at typographic flaws or inconsistencies!).
> 
> But it is /not/ a book you use to learn a new topic.  It is not a book 
> you use to learn about AVL trees (it does not even mention them by that 
> name), either in terms of what they are used for, how they work, or how 
> they may be implemented.  You will learn more that is relevant to you 
> from an animated gif on the Wikipedia page than from reading the entire 
> chapter in "Fundamental Algorithms".
> 
> If you want to understand how you can prove the algorithmic complexities 
> of different tree structures and their algorithms, and to better 
> understand how to prove the tree invariants, and to better understand 
> how to make your own interesting tree structures - /then/ studying that 
> part Knuth's book could be useful.  It is not a book you read, it is 
> something you have to study.
> 
> And like "The C Programming Language", it suffers from age - you can't 
> learn modern C from a 50 year old book, and you can't learn modern 
> coding from a 60 year old book.

When I first looked at it wasn't quite that old!

> Far and away the biggest mistake of the 
> books - IMHO - is the use of a mythical assembly as the language for the 
> programs instead of a high-level pseudo-code that made the interesting 
> stuff clear instead of bogging it down in irrelevant detail.

This 'MIX' language was something that astonished me even then. Not only 
was it assembly that would totally obscure whatever algorithm was being 
expressed, but it was a weird made-up assembly with unusual byte and 
word sizes.
I understand that more recent editions use an updated 'MMIX' language: 
now the registers are 64 bits, and there's a lot more of them. This is 
still like publishing a book of algorithms using ARM64 assembly to 
express them.

It's not clear what he had against HLLs; perhaps he thought an actual 
HLL would soon be superseded? Then pseudo-code should have been used.
Technical Details
Message-ID: <11aaggn$mu6q$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <86ece2kppv.fsf@linuxsc.com> <11a5h8m$2t8e8$1@dont-email.me> <865wzdl3xz.fsf@linuxsc.com> <11a6qi4$3cv2b$1@dont-email.me> <86wlrsjqq9.fsf@linuxsc.com> <11a8ta9$6463$1@dont-email.me> <86jynrjrf3.fsf@linuxsc.com> <11aa8vb$jk93$1@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: AVL tree insertion - programming exercise
Date: Fri, 9 Oct 2026 11:43:35 +0100
Organization: A noiseless patient Spider
Lines: 60
Message-ID: <11aaggn$mu6q$1@dont-email.me>
References: <86ece2kppv.fsf@linuxsc.com> <11a5h8m$2t8e8$1@dont-email.me>
 <865wzdl3xz.fsf@linuxsc.com> <11a6qi4$3cv2b$1@dont-email.me>
 <86wlrsjqq9.fsf@linuxsc.com> <11a8ta9$6463$1@dont-email.me>
 <86jynrjrf3.fsf@linuxsc.com> <11aa8vb$jk93$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Fri, 09 Oct 2026 10:43:36 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="751834"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/fCt6ozQvdQN9D3DxiY0A7"; posting-host="d73e6a36f528487352ffdbf36fa0fb8d"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:n1SJZtNkT4d1jjQ519qjvjeE3pk= sha256:Th7ZMrm3jLWy7TvQnIiVBKDYF9dpPX+LByNai2Dxa9c=
	sha1:UVjwpeb9Ndb5geCn1SnMevn9x4M= sha256:mpTglZOeZ0UYmV60wwb26UR9MnclOTkCkACO+ooBWN8=
In-Reply-To: <11aa8vb$jk93$1@dont-email.me>
Content-Language: en-GB