Skip to content

Conversation

dpbutter
Copy link
Contributor

@dpbutter dpbutter commented Aug 6, 2025

Per our discussion last year, here is a better version of sort_sum that offloads the sorting into a new subroutine in tree.hh.

@kpeeters
Copy link
Owner

kpeeters commented Aug 7, 2025

What was the motivation to introduce a new sort_subtree into tree.hh, when there is already sort?

@kpeeters
Copy link
Owner

kpeeters commented Aug 7, 2025

For reference: the discussion referred to above is in PR #286.

@dpbutter
Copy link
Contributor Author

dpbutter commented Aug 7, 2025

The existing sort seems dependent on the compare_nodes class, which only compares on the data of the node in question (i.e. the root node of the subtree to be sorted). So without breaking the tree.hh API, it seemed I couldn't use the existing sort to accomplish this.

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

Successfully merging this pull request may close these issues.

2 participants