🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.c
Article #314

Re: AVL tree insertion - programming exercise

#314
From: chine.bleu
Date: Tue, 13 Oct 2026 08:38
18 lines
2016 bytes
Tim Rentsch wrote:
> sons[2] array.  These links are basically pointers, but held
> as uintptr_t so they can take one of the bits to mean "tall",
> which means taller than the other subtree of the node.  The
> tree structure should maintain an invariant that at most one

Memory is cheap. Do not encode tags into low bits of an address unless 
you really know what your doing. As a precaution check the return 
address of malloc

	p = malloc(m);
	if ((uintptr_t)p)&1!=0) abort();

-- 
Siri Seal of Disavowal #777-000. Disavowed. Denied.  @
NO KINGS    For I desire mercy not sacrifice.       /|\
The Church of the Holey Apple .signature 5.5        / \
of Discordian Mysteries. This post insults Islam. Mohamed
Technical Details
Message-ID: <11akqm4$c6h9$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>

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: "chine.bleu" <chine.bleu@yahoo.com>
Newsgroups: comp.lang.c
Subject: Re: AVL tree insertion - programming exercise
Date: Tue, 13 Oct 2026 01:38:29 -0700
Organization: semi-chaotic
Lines: 18
Message-ID: <11akqm4$c6h9$1@dont-email.me>
References: <86ece2kppv.fsf@linuxsc.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 13 Oct 2026 08:38:29 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="399913"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/9LeA0LeNhPtcKntLdcJIeIejng/Lx6GA="; posting-host="fa1e9d685115d13ed4b742d0169ce6d8"
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:32.0) Gecko/20100101 Firefox/32.0 SeaMonkey/2.29.1
Cancel-Lock: sha1:TK6Ct+CquZGAIVBsrq0FWYUa8RE= sha256:fy5M4fAKwmm8kEFZRLjM+2MkGKSKEq1Xzsz3ArcODgA=
	sha1:jlrlPlTIbLkBhk44g2TlA+1JuXM= sha256:eytdU63UbVde1JQZBYKtBUq0bnTgRetNXUV7+moN67U=
In-Reply-To: <86ece2kppv.fsf@linuxsc.com>