Ch13 Homework

13.4.2. Ch13 Homework#

  1. Implement a function is_balanced(text) that checks whether parentheses in a string are balanced.

  2. Create a queue-based simulation of a customer-service line with at least five customers.

  3. Represent a small company hierarchy as a tree and print it with indentation.

  4. Represent course prerequisites as a graph using a dictionary.

  5. Write a short paragraph comparing BFS and DFS. Include one situation where each would be useful.