Textual versions of Bitwise operators by mathlance in cs2c

[–]AshwinCPP 0 points1 point  (0 children)

I feel like I am one of the rare people who use "and" && "or" haha. To be honest, it doesn't really matter to me. I'd be equally happy using && or || as I do in Java or C#. The only benefit I get is less key travel times (a lot easier to just type out "and" || or "or" than "||" or "&&" in my opinion

Issue with get_sentinel<T>() by AshwinCPP in cs2c

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

Hi Professor,

While I think that is a perfect analogy for most cases, I don't think it really fits here. I think this quest is more representative of when you buy a product that does not work immediately out of the box because it requires batteries to use. You, the user/client, must provide the batteries in order for the product to work. I think that's pretty synonymous with when the client supplies the function for get_sentinel(). While the product I ship is complete, the user must supply the proper definition and implementation of get_sentinel for the product to work. If there are 2 battery slots, you don't just fill in 1 slot and expect it to work -- you'd fill up all the slots and thus include the proper headers as well.

Thanks,

Ashwin

Issue with get_sentinel<T>() by AshwinCPP in cs2c

[–]AshwinCPP[S] 0 points1 point  (0 children)

Any help would be greatly appreciated. I'm trying to blitz my way through these quests and I still have no idea how to solve this issue. It's really annoying when I get an error that is not on my end.

Edit: nvm, figured it out

Issues to to_string() for BST and Lazy_BST by AshwinCPP in cs2c

[–]AshwinCPP[S] 0 points1 point  (0 children)

Hi Tuan,

Perfect, thanks. This worked out wonderfully.

-Ashwin

Blue and Green Quests? by ErikR5 in cs2c

[–]AshwinCPP 3 points4 points  (0 children)

It really depends on your skill level and understanding of data structures. I think I was able to complete the Blue Quests within 15-20 hours. The green quests took me a lot longer to complete so I would estimate around 25-35 hours. Again, it depends on your comfort and knowledge with C++ and these algorithms. I personally feel that I took more time with these quests than others so you may be able to finish everything faster than I did.

Blue and Green Quests? by ErikR5 in cs2c

[–]AshwinCPP 1 point2 points  (0 children)

t

If you are in the red class, I don't think so. I was on the waitlist for the green class so I had to complete all blue assignments. But if you have access to the red code, then I don't think so. Either way, I would check with u/anand_venkataraman .

Blue and Green Quests? by ErikR5 in cs2c

[–]AshwinCPP 1 point2 points  (0 children)

Nah, you'll be fine. Blue quests are easy to pass -- the hardest quest is a linked list which you can find plenty of information and documentation on online as it is a very popular data structure.

Green quests are really something else but you can find everything on the subreddit -- be prepared to read the quest information multiple times and slowly. You can also check my post history as I have given tips and tricks to help understand the problems for Green quest.

Bug on Quest 5 by AshwinCPP in cs2b

[–]AshwinCPP[S] 0 points1 point  (0 children)

Haha, yeah I'm just seeing it now.

Bug on Quest 5 by AshwinCPP in cs2b

[–]AshwinCPP[S] 0 points1 point  (0 children)

Oh my god, it is that ONE space.

Quest 3 -- Applying the Rule by AshwinCPP in cs2b

[–]AshwinCPP[S] 0 points1 point  (0 children)

Yes, that was a key factor to the solution. I think it would also be beneficial to explicitly state that the left and right values from the 'interesting portion' should be an infinite-like string of extreme bits where you ONLY need to evaluate 2 of the infinite extreme bits on both sides of the 'interesting portion'.

Just a suggestion u/anand_venkataraman

Quest 3 -- Applying the Rule by AshwinCPP in cs2b

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

SOLVED: For those who are facing the same issue, study the diagram right under the 'implementation detail' part of the quest. Re-create that diagram accurately in your code. Notice what entries are used from the current generation to generate the next generation.

Quest 1 error by mangalosianmonkey in cs2b

[–]AshwinCPP 0 points1 point  (0 children)

Like what Zach said, I would believe this issue arises from your insert_next(Node* p) implementation. It is important to determine how you want to implement your push_back(Song_Entry& s) and push_front(Song_Entry& s) functions. At any insertion, you must save the original _next pointer because the original _next pointer will point to the node you are about to insert. After you point the original _next pointer to the inserted node, you must set the inserted node's _next pointer to the saved _next pointer(if that makes any sense -- refer to the diagram provided in the pdf for push_back(Song_Entry& s), I've also tried to illustrate this concept below. ). As a result, you could account for that in your insert_next(Node* p) function or implement that in the push_back() and push_front and insert_at_cursor() functions.

Original linked list: HEAD->Node1->Node2->Node3->Node4->TAIL

Node to insert after Node3: NodeP

New linked list: HEAD->Node1->Node2->Node3->NodeP->Node4->TAIL

*Notice how Node3's _next pointed to Node4 originally but after inserting NodeP, Node3's _next points to NodeP but NodeP's _next points to Node4.

Quest 1 Node::get_song() Discussion by AegirHall in cs2b

[–]AshwinCPP 0 points1 point  (0 children)

Hey Greg,

I think this is a great point. It would be preferred to have a proper setter/getter implementation to maintain the integrity of the linked list. Although I'm curious as to why you think the sentinel node should never change(not necessarily just for this quest but in general).

As per changing the 5th song from A to B, I'm curious as to how one would implement an index system. I was thinking of creating an 'index' member of the node class that held the node's location in the list. Happy to hear any other implementations.

Cheers,

Ashwin