The following algorithm is followed by a person every morning when they get up from bed to go to school
Wake up
Brush teeth
Put on shirt
Put on pants
Put on socks
Put on shoes
Tie shoes
Which concept does this algorithm BEST demonstrate?
A. Sequencing
B. Selection
C. Iteration
D. Execution
A. Sequencing
A school is creating class schedules for its students. The students submit their requested courses and then a program will be designed to find the optimal schedule for all students.
The school has determined that finding the absolute best schedule cannot be solved in a reasonable time. Instead they have decided to use a simpler algorithm that produces a good but non-optimal schedule in a more reasonable amount of time.
Which principle does this decision best demonstrate?
A. Unreasonable algorithms may sometimes also be undecidable
B. Heuristics can be used to solve some problems for which no reasonable algorithm exists
C. Two algorithms that solve the same problem must also have the same efficiency
D. Approximate solutions are often identical to optimal solutions
B. Heuristics can be used to solve some problems for which no reasonable algorithm exists
a general description of a task that can (or cannot) be solved with an algorithm
Problem:
Provides a "good enough" solution to a problem when an actual solution is impractical or impossible
Heuristic:
What does All that and a bag of chips mean?
a. What your lunch order is
b. someone or something exceptional, outstanding, or extra special.
c. you're spicy, crispy, and always ready to dip into the fiesta of life.
d. ordering everything, including the bag of chips
b. someone or something exceptional, outstanding, or extra special.
The algorithm below is used to find the largest element in a list of numbers.
By modifying one of the lines in the program it is possible to make the algorithm find the SMALLEST element. Which line would need to be modified and how?
01 target <- list[1]
02 FOR EACH num IN list
03 {
04 IF(num > target)
05 {
06 target <- num
07 }
08 }
09 DISPLAY(target)
A. Line 01 becomes target <- list[2]
B. Line 04 becomes IF (num < target)
C. Line 04 becomes IF (num = target)
D. Line 01 becomes list[0] <- target
B. Line 04 becomes IF (num < target)
Which of the following algorithmic efficiencies would be considered LEAST efficient?
A. Linear
B. Constant
C. Polynomial
D. Exponential
D. Exponential
putting steps in an order.
Sequencing:
A problem with the goal of finding the "best" solution among many (e.g., what is the shortest path from A to B?)
Optimization Problem:
What does Talk to the Hand mean?
a. When someone is complaining about what time an event is.
b. An expression right before someone gets slapped
c. Used to interrupt someone who is speaking
d. Speak to the dubious cult leader "The Hand" about joining his Entourage
c.used to interrupt someone who is speaking
A town government is designing a new bus system and are deciding where to put the different bus stops. They want to pick the collection of locations that minimizes the distance anyone needs to walk in order to get to at least one bus stop. What term best defines the kind of problem?
A. A decision problem
B. An optimization problem
C. An undecidable problem
D. An efficiency problem
B. An optimization problem
Which of the following best describes the existence of undecidable problems?
A. Undecidable problems are problems for which more than one algorithm solves the problem and computer scientists have not yet chosen the algorithm they believe is best
B. Undecidable problems are problems for which an algorithm can be written that will produce the same output for at least two possible inputs
C. Undecidable problems are problems for which an algorithm can be written that produces a correct output for all inputs but in an unreasonable time
D. An undecidable problem is a problem for which no algorithm can be constructed that always produces a correct output
D. An undecidable problem is a problem for which no algorithm can be constructed that always produces a correct output
doing some steps over and over
Iteration:
A model in which programs run in order, one command at a time.
Sequential Computing:
What does the term, "Crunk" mean?
a. slang term primarily associated with Southern hip-hop culture,
b. A crying drunk
c. PULL ZE LEVER CRUNK!
A. the action we would describe the drool coming out of kids mouths while they sleep in class
B. A term that means the same as lingo Mr. Anderson's generation would use, "swag."
C. It indicates the direction of my students grades, who don't turn in their work.
Which of the following is NOT a reason to include comments in programs?
A. Comments help the computer decide whether certain components of a program are important.
B. Comments help programmers debug issues in their own code
C. Comments help document how code was written for other programmers to use
D. Comments enable programmers to track their work throughout the development process
A. Comments help the computer decide whether certain components of a program are important.
A group of students writes their names and unique student ID numbers on sheets of paper. The sheets are then randomly placed in a stack.
Their teacher is looking to see if a specific ID number is included in the stack. Which of the following best describes whether their teacher should use a linear or a binary search?
A. The teacher could use either type of search though the linear search is likely to be faster
B. The teacher could use either type of search though the binary search is likely to be faster
C. Neither type of search will work since the data is numeric
D. Only the linear search will work since the data has not been sorted
D. Only the linear search will work since the data has not been sorted
A search algorithm which checks each element of a list, in order, until the desired value is found or all elements in the list have been checked.
Linear Search:
A model in which programs are run by multiple devices
Distributed Computing:
What does the term, "Da Bomb" mean?
a. the bomb the US dropped on Japan
b. A hotsauce, featured on hotones
c. something that is really cool
c. something that is really cool
This graph shows the efficiencies of two different algorithms that solve the same problem. Which of the following is most efficient?
A. These algorithms are equally efficient
B. Algorithm A is more efficient than algorithm B
C. Algorithm B is more efficient than algorithm A
D. The algorithms have different efficiencies depending on the input size
D. The algorithms have different efficiencies depending on the input size
A computer is performing a binary search on the sorted list of 7 numbers below. What is the maximum number of iterations needed to find the item?
[1, 5, 20, 50, 51, 80, 99]
A. 1
B. 3
C. 6
D. 7
B. 3
Algorithms with a polynomial efficiency or lower (constant, linear, square, cube, etc.) are said to run in a reasonable amount of time.
Reasonable Time:
The time used to complete a task sequentially divided by the time to complete a task in parallel
Speedup:
What does the phrase, "WAAAAAAAAAZZZZZZZZZZZZZZZZZZZ UUUUUUUUUUUUUUUUUUUUUUUPPPP" mean?
a. indicates the person speaking is having a stroke
b. reference the movie - "Scary Movie."
c. Talking about the state of the economy.
b. reference the movie - "Scary Movie."