Question: 1. Your job is to write a program that plays chess. Might CheaaBoard be an appropriate dass? Explain your answer. 2. In the same program,
1. Your job is to write a program that plays chess. Might CheaaBoard be an appropriate dass? Explain your answer. 2. In the same program, might MovoRiece be an appropriate class? Explain. 3. What might you do if a proposed object has more than 10 responsibilities? 4. Factorial can be computed iteratively (with a loop) or recursively. Which approach will produce a better result in most cases? Explain the problems with the approach that you think is worse. Ifone were to place the values; eat, tea, Juliet, Ugh, and VIl into a stack, list the same value below in the order they would be removed. 5. 6. If one were to place the values; eat, tea, Juliet, Ugh, and VIl into a queue, list the same value below in the order they would be removed 7. Why did we determine to keep a count of the items within our data structures as an attribute? 8. If we did NOT keep the count in an attibute, what would the Big O of the get size method be for the queue, stack, and binary search trees? Hint: It would be the same. 9. What is the Big-O of these data structures if we do keep a count? 10. When adding a value to a stack, where is the new value placed? 11. When adding a value to queue, where is the new value placed? 12. When adding a value to a binary search tree, how to we determine where the new value will be DOLL 1. Your job is to write a program that plays chess. Might CheaaBoard be an appropriate dass? Explain your answer. 2. In the same program, might MovoRiece be an appropriate class? Explain. 3. What might you do if a proposed object has more than 10 responsibilities? 4. Factorial can be computed iteratively (with a loop) or recursively. Which approach will produce a better result in most cases? Explain the problems with the approach that you think is worse. Ifone were to place the values; eat, tea, Juliet, Ugh, and VIl into a stack, list the same value below in the order they would be removed. 5. 6. If one were to place the values; eat, tea, Juliet, Ugh, and VIl into a queue, list the same value below in the order they would be removed 7. Why did we determine to keep a count of the items within our data structures as an attribute? 8. If we did NOT keep the count in an attibute, what would the Big O of the get size method be for the queue, stack, and binary search trees? Hint: It would be the same. 9. What is the Big-O of these data structures if we do keep a count? 10. When adding a value to a stack, where is the new value placed? 11. When adding a value to queue, where is the new value placed? 12. When adding a value to a binary search tree, how to we determine where the new value will be DOLL
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
