Yeah, I wasn't sure if an arrayList would work the same way as far as pass by reference or value.
I also believe that you'd never run into a stack overflow issue, but I can't really be sure. From looking at the code, I think you could represent the recursion like a tree. And the height of the tree will be the number of elements concatenated to spell the word. And the depth of the recursion will be the height of the tree. A parent node has 100+ potential children, the children being the next element to append to the word. So you'll only be like 1-10 levels of recursion deep at any given time. This is my guess on the matter, but I've never really done any analysis on how much space a recursive algorithm could use in a worse case or anything like that. Is my description of the recursion correct here?
I also believe that you'd never run into a stack overflow issue, but I can't really be sure. From looking at the code, I think you could represent the recursion like a tree. And the height of the tree will be the number of elements concatenated to spell the word. And the depth of the recursion will be the height of the tree. A parent node has 100+ potential children, the children being the next element to append to the word. So you'll only be like 1-10 levels of recursion deep at any given time. This is my guess on the matter, but I've never really done any analysis on how much space a recursive algorithm could use in a worse case or anything like that. Is my description of the recursion correct here?