From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ua0-f176.google.com ([209.85.217.176]) by ur; Mon Dec 12 13:03:01 EST 2016 Received: by mail-ua0-f176.google.com with SMTP id b35so88698205uaa.3 for <9front@9front.org>; Mon, 12 Dec 2016 10:02:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=hAbPbKH5Msi3apUzC3IzEambGGmdNa9it+r/y9Mqab0=; b=Ks8c4ayDxreUjBd6BYeBcJAYjL4nNVqB0VqaqOKV77ZkXjYKnA87lYRAuOOiqhQ3pX /p9fyiWsdFwrE5UMIdBpnlVWoyyhAVlr/2MLfeKCN3T+CNfNUt2EvQYeq+BkRX6/yahz zd2bQH098mo0hkVzNTbZhBIMt7EuzOpf5pTfZQ/qENlXcjp40n68Q+kZfBsMijfkPVt8 tESFASvqXvychBGMVDOccGhPIeBZR7tNguqfcYzlKdAULT/wjt9CUqzoG2Iw3IUzef+Q xSb4RKP4c65TaoI0H2ev45wfN5B5IrG+v0NjVaKGpZMich7ui4BX/Z7sMW291HSeyXOv 5Yhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=hAbPbKH5Msi3apUzC3IzEambGGmdNa9it+r/y9Mqab0=; b=IfCaD0oMSwuAkeAaOe9yaqq+KRHVI+BRolRSFVKaRbq+BINA95j+I36aYNT2/ZC+PA 7bClEaL+3OL8+PDF2VIcavhkPoplz9MscuFnOTDTg5a9hJpInK9XCrsjqcpnUot+LE0C yCMMBHN2GqnNd0fykvv+FYr08kD1OVxo6CARM5WVwlMZqpKmOMqZNZ0UUewLDetOhVg/ QfUZFxJ76/1DYedkrWHCoMhcStzbtvmwv4ieMOBoslie0ZlonqptGmuf7lWGTlJ56SDD ftrc6+tK95Qc72UZGQlZEAPVqTUmCLoWpKHrQJNNwCpqjCUQpppUGC1XiunbngMQaMFO Q4xg== X-Gm-Message-State: AKaTC00SzbWISFUILVnKHNkx8Qlb1j8hEMzEVgRSmUtPNtnMFBHRt3e6Gtlw7mvch+kNqBhFGugqqY/0p/GnWA== X-Received: by 10.176.65.33 with SMTP id j30mr74744038uad.94.1481565779489; Mon, 12 Dec 2016 10:02:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.48.21 with HTTP; Mon, 12 Dec 2016 10:02:59 -0800 (PST) In-Reply-To: References: From: Benjamin Purcell Date: Mon, 12 Dec 2016 12:02:59 -0600 Message-ID: Subject: Re: [9front] New Balanced Search Tree Implementation To: 9front@9front.org Content-Type: text/plain; charset=UTF-8 List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: engine-aware WEB2.0 over TOR hypervisor database-oriented controller > a better way would be to provide separate functions, that way if you > only use bstcreateavl(), you'll only link in the avl code... but you > can still have your common interface structure. This is now done and the repos are updated. The venti code also has been updated. On Mon, Dec 12, 2016 at 11:18 AM, Benjamin Purcell wrote: >> Then why even implement it then when its always slower than avl? >> you could get rid of the indirection... > > 1. In the interest of keeping 9front in the tradition of not only an > OS we use but also an OS for research and learning, I think it's good > in its own right to have an implementation of another classic balanced > tree with interesting invariant properties. > 2. RB trees are often touted as having better behavior than AVL trees > and especially in recent years there has been controversy over the > left leaning variant. Having comparable implementations of the two > trees together in one OS gives a living example of why AVL and only > AVL is the one true BST. This is In the same way that keeping acme and > sam around clearly shows that ED is the one true editor. > >> another point about using enum constants to set the algorithm mode >> has the disadvantage that you always have to link in all the implementations >> even if you are not using them... >> >> a better way would be to provide separate functions, that way if you >> only use bstcreateavl(), you'll only link in the avl code... but you >> can still have your common interface structure. > > That is a great point and I'll make that change soon. > >> -- >> cinap