Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6365121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:15:10+00:00 2026-05-25T00:15:10+00:00

Using the BTree package at SqueakSource (or any other you may know) and given

  • 0

Using the BTree package at SqueakSource (or any other you may know) and given the following tree

-Root
|
--Node1
|
--Node2
---Node21
---Node22
---Node23
----Node231
----Node232
-----Node2321
----Node233
|
--Node3

I’ve tried to write the following but without success:

  • Build the tree
  • Given Node23 answer its direct children
  • Given Node2 answer all its children
  • Given any Node, answer its parent
  • Collect all the children

This is NOT homework, the reason why I’m asking for a basic example is because in the case of BTree, documentation is almost inexistent, and tests are not good enough for figuring out basic usage, actually examples are mixed with asserts and using convenience methods.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:15:11+00:00Added an answer on May 25, 2026 at 12:15 am

    If you’re not so concerned with execution speed, there is an extensively documented package in SqueakSource for that purpose http://www.squeaksource.com/TreeLW.html which was originally released for VisualWorks.

    One class you may use for building your tree is SKPVTreeLW, which supports value, subtrees, supertree, and a key. You may achieve your example implementing something like this:

    t := SKPVTreeLW
        key: '1'
        value: 'N' 
        subTrees: { 
            ( SKPVTreeLW key: '2' value: 'A' ) .
            ( SKPVTreeLW key: '3' value: 'B' subTrees: { 
                ( SKPVTreeLW key: '31' value: 'C' subTrees: { ( SKPVTreeLW key: '311' name value: 'D' ) } ) .
                ( SKPVTreeLW key: '32' value: 'E' subTrees: Array empty ) } ) .
            ( SKPVTreeLW key: '4' value: 'F' ) .
            ( SKPVTreeLW key: '5' value: 'G' ) .
            ( SKPVTreeLW key: '6' value: 'H' ) }.
    " Subtrees of node 'B' "
    t recursiveDetect: [ : s | s value = 'B' ] 
            inclusive: true 
            topDown: true 
            breadthFirst: true.
    " or searching by key "
    t atKey: '3'
    " Childrens as nodes "
    t recursiveSubTrees: true.
    " Direct children "
    t values.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create indexes without the USING BTREE clause. Is there any advantage of using
Using ASP.NET MVC there are situations (such as form submission) that may require a
CREATE INDEX alias_pub_idx2 ON info.palias USING btree (publisher_id, player_id, pub_player_id); CREATE INDEX alias_pub_idx3 ON
The following query is using temporary and filesort. I'd like to avoid that if
If I have something like: CREATE INDEX idx_myTable_field_x ON myTable USING btree (field_x); SELECT
I'm getting the following error when trying to return the value using the operator*()
Using online interfaces to a version control system is a nice way to have
Using PyObjC , you can use Python to write Cocoa applications for OS X.
Using C# .NET 3.5 and WCF, I'm trying to write out some of the
Using TortoiseSVN against VisualSVN I delete a source file that I should not have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.