|
|
c m s c 214
f a l l 2 0 0 1 |
Yes.
When you leave the dungeon, you are not in any room. This is as if you were starting the game (players and robots do not start in a room). You may enter a room afterwards. You continue to hold objects. We won't test dropping an item if the player does not have the item and is not in the dungoen.
A robot can attempt to leave a team, but it will merely say that the robot is not on any team, since a robot still can't join a team.
No. It was meant to help you think about breaking down the task of adding a node into a BST. If you think that's complicated (I'm not sure why you would), or have a different way to do it (that's entirely possible), then you don't have to implement these methods.
No. They are still carrying the items as they leave the dungeon.
Yes, they can, by GOTO_ROOM.
No. You have to receive special permission from your instructor, after demonstrating what kind of "delete" you want to do. If your instructor approves it, then fine. You will save time by using one of the four methods described.
Yes, they will. The grading TAs will have to visually check these.
Think about it, draw out the cases, etc.
No, no, and no! Each data value is in ONE node, and that node is in the BST AND it is in the "doubly linked list" (so to speak).
Depends on what the goals are. If it's efficiency, then no. For example, it's less space-efficient to use recursive functions, e.g., findMin and findMax can use constant space instead of O(n) space, and the copy constructor and assignment operator potentially runs in O(n^2) instead of O(n) if you use "add" to implement (think why).
Again, the one of the goals of this project is to practice lots of recursion. Efficiency is important, an issue you should always consider, but there are other issues too, such as ease of coding and correctness, and of course, learning how to write recursive functions.
You can declare a private helper function, to do the recursion (i.e., you can overload it. However, you can't change the one given to take a Node * parameter.
Yes, you can. Be careful handling predecessors/successors?
Yes, you can. Obviously, quicksort uses recursion, but you can use loops (unlike the other recursive functions you're asked to write).
Yes, you can. It's not necessary (but it can be more efficient).
Yes. However, since one of the goals of writing a BST is to get practice using recursion, you might prefer to write a recursive version (admittedly, this will be O(n) time, instead of O(1) time, so decide on whether recursion practice or efficiency is more important to you---either is fine for us).
Yes. That's what was meant. It's been corrected in the description.
MovieBstSortedList.cpp has just been posted with the print methods.
Some. The .h files and some drivers are posted. You should implement MovieBstSortedList.cpp, then templatize to make it ObjBstSortedList.cpp, then you can create BstSortedList.cpp to work with your project 2. It should replace SortedList.cpp in Team.