Enrol to start learning
Reading is open to everyone. Enrolling is free, and it is what unlocks the audio lessons, practice tests and progress tracking.
2.1.4. Handling Holes
This section
Practice test
12 questions on this section. Wrong answers show you what to read again.
Sign up to take itWhole chapter
Revision test
Mixed questions from across the chapter. Your answers get marked.
Sign up to take itQuick
Flashcard drill
4 cards from this lesson. Good the night before a test.
Try these first
- 1.
What is the number of paths to point (1,0) from (0,0)?
Hint
Think of how you can only move from (0,0) to (1,0) directly.
- 2.
If a hole is placed at point (2,2), how many paths can go through it?
Hint
Consider what happens when a point is obstructed.
- 3.
What is the base case for paths(0,0)?
- 0
- 1
- 2
Hint
Consider what it means to be at the origin without moving.
- 4.
Can paths go through holes?
- True
- False
Hint
Think about what a hole represents in terms of pathfinding.
- 5.
Design a 5x5 grid with two holes and calculate the number of unique paths from (0,0) to (4,4). Provide a step-by-step explanation.
Hint
Map out the valid paths while taking into consideration each hole's impact.
- 6.
Explain how the choice between using memoization versus dynamic programming can affect the performance of computing paths on a grid with multiple obstacles.
Hint
Reflect on memory usage versus time efficiency.
Exercises
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
4 more questions available
Enrol freeQuiz
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting
2 more questions available
Enrol freeChallenge Problems
Total Questions
2
Estimated Time
4 min
Passing Score
70%
Instructions
- Read each question carefully
- You can use hints if you need help
- Complete all questions before submitting