comp.lang.ada
 help / color / mirror / Atom feed
From: Jeremiah <jeremiah.breeden@gmail.com>
Subject: Questions concerning "Simple Components"
Date: Tue, 3 Nov 2015 18:16:07 -0800 (PST)
Date: 2015-11-03T18:16:07-08:00	[thread overview]
Message-ID: <59c99dce-9cc6-4aba-9c5e-a5dd22ef7fea@googlegroups.com> (raw)

I really like a lot of the items found in the Simple Components library, but had a few questions on their usage.  Specifically:

Generic_B_Trees have a generic package parameter "Width" which has the following description from the website:
"Width is the size of the bucket of key-value pairs allocated per tree node;"

This doesn't make a lot of sense to me.  I'm sure I am just missing something simple, but what is the "bucket" being referenced?  Is it terminology for how many key value pairs can be created before more memory has to be allocated?  The "per tree node" part also throws me off a little bit because on a binary tree, I would expect only one key/value pair per node.  That said, I could be misunderstanding some of the terminology.  Can anyone add some clarity to what exactly the Width parameter does?

2nd question:
I really like the concept of Generic_External_B_Tree which use persistent storage to save data.  One thing I am trying to get a better handle on is a better way to handle the Root node address returned from Get_Root_Address.  I need this value to create the tree in a later application invocation.  I know I could just save it in another file or possibly add a root address value to all my tree nodes, but both of those methods seem wasteful.  What methods do yall use to store the root node address?  I thought about just writing it to the beginning of the Persistent_Array, but I don't know how well mixing types (a raw Byte_Index and a Generic_External_B_Tree) in a single Persistent_Array will work.  I'm still digging through the code to see if I could do this in some manner, but if any of yall have suggestions on how to better manage the root node address, I would appreciate it.

Simple Components reference:
http://www.dmitry-kazakov.de/ada/components.htm#b-tree

             reply	other threads:[~2015-11-04  2:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-04  2:16 Jeremiah [this message]
2015-11-04  8:33 ` Questions concerning "Simple Components" Niklas Holsti
2015-11-04  9:09 ` Dmitry A. Kazakov
2015-11-04 12:39   ` Jeremiah
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox