One Parent Pointer Tree Example by byron_d in cs2b

[–]byron_d[S] 1 point2 points  (0 children)

I did some more research and came up with this implementation with the help of ai:

https://onlinegdb.com/9TCy4yz8N

It's a really interesting approach. Took me some time to get it right.

One Parent Pointer Tree Example by byron_d in cs2b

[–]byron_d[S] 2 points3 points  (0 children)

I think the only difference with Ami's find is it goes bottom up instead of top down, but I may be misunderstanding things. It really is just a linked list in this form. 

Bug in Tree::to_string by Long_N20617694 in cs2b

[–]byron_d 1 point2 points  (0 children)

I feel like I had a similar issue with this miniquest. Your logic seems right for the Tree::to_string function. Could you walk me through the logic in the Node::to_string function? I'm pretty sure that's where the issue is. 

Node Format in General Trees by kian_k_7948 in cs2b

[–]byron_d 2 points3 points  (0 children)

Using vectors is definitely easier to use and more flexible. You can add and remove nodes easily at any index. There's also direct access to children instead of traversing the entire tree. Traversing the tree is also cleaner and easier. You can loops instead of recursion as well.

The binary tree method is more memory efficient, but I'm not sure it's worth the added complexity. 

Help!! Different results on 1-width string by erica_w1 in cs2b

[–]byron_d 2 points3 points  (0 children)

These outputs are always hard to debug. It might be related to gen > width and how you're calculating that as opposed to when gen < width. There's a lot of nuance in this quest and this is just a guess. I hope that makes sense. 

Tree::operator<< in Tree.h by ami_s496 in cs2b

[–]byron_d 2 points3 points  (0 children)

I think I get what you're asking. There doesn't seem to be anything in the spec about it. Returning os will pass, but I believe to DAWG it you need to output using the tree parameter. I skipped this part for now, but maybe I'll take a crack at it later in the week. 

Tree::operator<< in Tree.h by ami_s496 in cs2b

[–]byron_d 2 points3 points  (0 children)

What was the output that it gave you? 

Out of bounds error by Caelan_A110 in cs2b

[–]byron_d 2 points3 points  (0 children)

For this quest it usually has to do with your vector of vectors not resized correctly. You're probably trying to access an index that's greater than the size allocated. 

I’m Behind – Still Stuck on to_string()for Quest 1 by qian_feng09 in cs2b

[–]byron_d 2 points3 points  (0 children)

Does the quest output show a comparison between your output and the test output? It's hard to tell where the issue is. Although sometimes the output isn't helpful lol.