4 ms·
Chips have ability to run vector operations that can add a bunch of numbers. The issue is that recursion in software development is relatively rarely about ari
by twawaaay 4y ago
Chips have ability to run vector operations that can add a bunch of numbers.
The issue is that recursion in software development is relatively rarely about arithmetic operation. For example, you might want to traverse a tree of objects (like a filesystem folder) to run some operation on them, etc.
In this case the intermediate information is pointers to where you are currently processing various folders in your tree structure, etc. In a loop you would have to create a data structure to hold these. In recursive function this would typically be spread in multiple frames on your stack pointing to objects in your heap.
- wizofaus 4y agoVector operations that perform the same fixed addition to each element, yes, but that's not really the same thing. And yes I'm very much in agreement that the real power of recursive algorithms is when working with tree-like data structures.
- twawaaay 4y agoYour question was, and I quote: > is there actually any chipset with the algorithmic ability to add more than 2 numbers altogether in one operation (without having to store intermediate results) I was just answering your question. I am not responsible for quality of your questions. What you do is you posted a question but had something else in mind. You got an answer but that answer does not match the question you had in your mind so now you think it is ok to berate somebody for not being able to read your mind.
- wizofaus 4y agoMy understanding is those vector operations don't , in fact, add more than 2 numbers together, but rather simultaneously add lots of pairs of numbers. Happy to be corrected and no berating intended.