User Portlet
Featured Contributor
Discussions |
---|
Yes, the [`"BinaryTree"`][1], [`"AVLTree"`][2], and [`"RedBlackTree"`][3] data structures each support an `"InOrderScan"` operation. [1]: https://reference.wolfram.com/language/ref/datastructure/BinaryTree.html [2]:... |
Thanks for the explanation. If NestGraph gives a non-tree for a given function and initial value, NestTree would still give a tree but would have duplicate branches, so I see why it makes sense to first build a graph. |
&[Wolfram Notebook][1] [1]: https://www.wolframcloud.com/obj/1c920f36-017d-426f-9136-3004b099baab |
For odd n, n is followed by 3n + 1, which is then followed by (3n + 1) / 2. My original comment skipped the intermediate 3n + 1 and went straight to (3n + 1) / 2, so the reverse direction also skipped from n = (3m + 1) / 2 to m = (2n - 1) / 3, which... |
Absolutely worth asking! I may submit a function to the Wolfram Function Repository to make these kinds of traversal order visualizations. |
-17 characters: r=RandomChoice;b=Black;ArrayPlot[Array[(f=#^2+#2^2;Which[f 10] |
&[Wolfram Notebook][1] [1]: https://www.wolframcloud.com/obj/56f4e3a6-630d-40b0-8a4b-f8be6fb19215 |
Hello all! I am excited to present "Tree Representation for XML, JSON and Symbolic Expressions" for the livestream tomorrow, 12 October 2022. The presentation will cover tree construction and representation, visualization, properties and... |
This is an interesting project. Have you checked out [ExpressionLineDiff][1] in the Wolfram Function Repository? You may be able to get some ideas from it. From example 7 it looks like you are representing diffs in the head as a list of diffs.... |
If you want to prevent any kind of evaluation in the input or output, you could use some kind of wrapper to do that for you: ``` In[1]:= SetAttributes[Formula, HoldAll]; ``` Then define your function to act on expressions with head `Formula`:... |