Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-level linked lists #282

Open
offthepiste opened this issue Sep 21, 2023 · 0 comments
Open

Multi-level linked lists #282

offthepiste opened this issue Sep 21, 2023 · 0 comments

Comments

@offthepiste
Copy link

offthepiste commented Sep 21, 2023

Complete newbie here....

I have been trying to find some reference to "multi-level linked lists" within the Rust community to no avail. And was wondering if this would be an interesting addition to "too many linked lists".

By multi-level linked lists I also mean an "n-ary" (non binary tree) of n leaf nodes and m levels. That is it aka a directed acyclic graph.

(Perhaps I am over thinking this ... and someone will point out that what I am talking about is a simple linked list where one list item / node can simply "branch" into one or more head items / leaf nodes?)

My "use case" does not require any double linking ... simply a straight hierarchy which will only branch at the list head / leaf node (that is, it will only append and is immutable) and grow .. thankfully not infinitely.

Also, data is immutable but not persistent, i.e. there will be no requirement to "update" values of inner or outer nodes, turn back time or to merge two or more branches..

In effect I am growing n Stacks where each list head / leaf node represents the top of a Stack, and through recursion I can track back up the "graph paths", i.e. the set of list tails / branches possibly to the root node or just to an inner node.

PS: have no interest in flattening g said multi-level linked list. Just want to treat them is a set of discrete & navigable (towards root) in effect Stacks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant