Question
Write an equation as each answer. 1.My program uses nested loops. The outer loop goes through each slot of my array with N slots.The inner
Write an equation as each answer.
1.My program uses nested loops. The outer loop goes through each slot of my array with N slots.The inner loop goes through each slot of the array.How many times an operation inside the inner loop is done?
2. There are N people and 4 rooms. Each person can choose which room to enter. How many possibilities are there of who will be in which rooms? (Hint: 4 possibilities per person)
3. My program uses recursion. Each time it calls F, the array (N slots) gets shorter by one slot until there are no slots left. How many times will F get called?
4. My program uses recursion. Each time it calls F, the array (N slots) becomes the size until there are no slots left. How many times will F get called?
5. My program plays chess perfectly. Assuming that there are 35 possible moves each time and each game ends in about 80 moves, my program examines every possible path before making the first move. How many board states will have to be examined?
Think of a tree (B = 80) and count the number of nodes.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started