8000 Reimplement `AnyN` as a tree operation · Issue #19 · arr-ai/frozen · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Reimplement AnyN as a tree operation #19
Open
@marcelocantos

Description

@marcelocantos

#9 will result in an MVP form of AnyN that uses Range(). A better implementation is to reuse as much of an existing tree as possible. The basic idea is to start building a new tree out of an old tree, Taking enough children till you exceed the desired count. Then take the last subtree that exceeded the limit and recursively call last_subtree.anyN(n - sum(other subtree counts)).

An efficient node count #20 would speed this up dramatically.

My initial thinking was to also look for optimal choices of subtrees to get as close as possible to n then choosing a small subtree to fill in the remainder. However, this will be ineffective because hash trees are extremely well balanced. Nothing will be gained by playing these sorts of games.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Low priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0