Article View: comp.lang.c
Article #337Re: AVL tree insertion - programming exercise
From: chine.bleu
Date: Tue, 13 Oct 2026 15:19
Date: Tue, 13 Oct 2026 15:19
37 lines
2508 bytes
2508 bytes
David Brown wrote: > On 13/10/2026 10:38, chine.bleu wrote: >> 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. > > Not any more! I started on 65K. > >> Do not encode tags into low bits of an address unless you really know >> what your doing. > > Agreed, as a principle. > >> As a precaution check the return address of malloc >> >> p = malloc(m); >> if ((uintptr_t)p)&1!=0) abort(); >> > > malloc always returns an address with suitable alignment for any > fundamental alignment on the target. Typically that means at least > 64-bit alignment (and thus the three LSB's are always zero), but it is > implementation dependent. > -- 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:
<11ali54$l670$2@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-mailReferences:
<86ece2kppv.fsf@linuxsc.com> <11akqm4$c6h9$1@dont-email.me> <11akuf1$bq6c$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: "chine.bleu" <chine.bleu@yahoo.com> Newsgroups: comp.lang.c Subject: Re: AVL tree insertion - programming exercise Date: Tue, 13 Oct 2026 08:19:01 -0700 Organization: semi-chaotic Lines: 37 Message-ID: <11ali54$l670$2@dont-email.me> References: <86ece2kppv.fsf@linuxsc.com> <11akqm4$c6h9$1@dont-email.me> <11akuf1$bq6c$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 13 Oct 2026 15:19:01 +0000 (UTC) Injection-Info: dont-email.me; logging-data="694496"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cEVR5OrZ3B/X7Q/7PQIQIaJuA7XdVz6E="; posting-host="d5e890c59907eaf254c24f4a19db3603" 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:HkjNuLrLXTFsBscaSM4zLqpDoHU= sha256:IpCb69K2UC9EnHkl5sGGisZtsFOec+LXSRcxejmCpP8= sha1:JvOYn4x5uKYPRKh22jxt1VQitPo= sha256:xUr59bmRyNe7LGU5wYsjtT5Jsjk3l6qjSiFNum/PkAs= In-Reply-To: <11akuf1$bq6c$1@dont-email.me>