BRAYDEN SAGA

Passionate about Software and Web Development

Studying Cybersecurity at Ngee Ann Polytechnic since 2023.



Building a Movie Enthusiast Application

Building a Movie Enthusiast Application

For our Data Structures and Algorithms (DSA) assignment, my teammate and I were tasked with creating a C++ application for a community of movie enthusiasts. The goal was to manage and display information about actors, movies, and their relationships using appropriate data structures and algorithms. This was an exciting challenge, especially since I decided to implement an AVL Tree, a data structure I had never worked with before. Here’s a breakdown of my experience and key takeaways from the project:


Project Overview

The application allowed users to:

  1. Add and update actors and movies.
  2. Display actors within a specific age range (sorted by age).
  3. Display movies released in the past 3 years (sorted by year).
  4. Display movies an actor starred in (sorted alphabetically).
  5. Display actors in a specific movie (sorted alphabetically).
  6. Display actors that a particular actor knows (based on shared movies).
  7. Rate different movies and actores
  8. Recommend the top rated movies and actors

We were required to use at least two data structures and demonstrate the application of algorithms like searching and sorting. Importantly, we were not allowed to use the C++ Standard Template Library (STL), which meant we had to implement everything from scratch.


My Contributions

  1. Data Structure Selection and Implementation:

    • AVL Tree: I chose to implement an AVL Tree to store and manage actors and movies. The AVL Tree is a self-balancing binary search tree, which ensures that search, insertion, and deletion operations are efficient (O(log n)). This was particularly useful for maintaining sorted lists of actors and movies.
    • Linked List: My teammate implemented a Linked List to manage relationships between actors and movies, such as which actors starred in which movies.
  2. Algorithms:

    • Sorting: I implemented in-order traversal for the AVL Tree to display actors and movies in sorted order (alphabetically or by age/year).
    • Searching: I used binary search within the AVL Tree to efficiently find actors or movies based on specific criteria (e.g., age range or release year).
  3. Advanced Features:

    • Actor Knows Relationship: I implemented a feature to display actors that a particular actor knows based on shared movies. This involved traversing the AVL Tree and Linked List to find indirect relationships (e.g., if Actor A and Actor B starred in the same movie, and Actor B and Actor C starred in another movie, then Actor A knows Actor C).

Challenges and Learning Points

  1. AVL Tree Implementation:

    • Learning how to implement and balance an AVL Tree was challenging but rewarding. I had to understand the concepts of rotations (left, right, left-right, right-left) to maintain the tree's balance during insertions and deletions.
    • Debugging the tree was tricky, especially when handling edge cases like duplicate entries or empty trees.
  2. Efficiency Considerations:

    • I learned the importance of choosing the right data structure for the task. The AVL Tree’s O(log n) complexity for search, insert, and delete operations made it ideal for managing large datasets efficiently.
    • Balancing performance with memory usage was also a key consideration, especially when dealing with nested relationships (e.g., actors knowing other actors).
  3. Collaboration:

    • Working with a teammate required clear communication and division of tasks. I focused on the AVL Tree and its operations, while my teammate handled the Linked List and file I/O for the CSV datasets.

Key Takeaways

  1. Understanding AVL Trees:

    • This project gave me hands-on experience with AVL Trees, a data structure I had only read about before. I now understand how self-balancing trees work and why they are useful for maintaining efficient search operations.
  2. Problem-Solving Skills:

    • Implementing the actor knows feature required creative problem-solving and a deep understanding of graph traversal concepts. It was satisfying to see the feature work as intended.
  3. Importance of Documentation:

    • Writing clear comments and documentation for our code was crucial, especially since we were not using STL. This practice helped us debug and understand each other’s code more easily.
  4. Real-World Applications:

    • This project showed me how data structures and algorithms are used in real-world applications, such as managing and querying large datasets efficiently.

Conclusion

This assignment was a fantastic learning experience. Implementing an AVL Tree from scratch and using it to solve real-world problems was both challenging and rewarding. I now have a deeper appreciation for the role of data structures and algorithms in software development and look forward to applying these skills in future projects.

If you’re working on a similar project or learning about AVL Trees, feel free to reach out—I’d be happy to share more about my experience!


#DSA #DataStructures #Algorithms #AVLTree #C++ #Programming #LearningJourney