Need help making Binary Search Tree Movie Program work.

I am working on a project right now that is meant to act as a small movie database. The binary search tree is meant to read info from this file:

http://www2.cs.uidaho.edu/~bruceb/cs121/Assignments/movies.txt

The program needs to be able to do a few things: Print out all the movie titles and only the titles, have the user input an actor and have the program print all the movies said actor is in, have the user input a title and the program will display all the actors in the film, and have the program print out all films released before 1975.

I'm very new to BSTs, so this has been especially difficult for me. I am not asking for any code, just advice on how to begin. Would it be better to have the user input something, then have the program search the file for that info, or would it be better to read the entire file into the tree first, and then search for the info in the tree?

Just FYI, I am not allowed to use the STL. Any advice/tips would be much appreciated.

Also, to head off anyone getting mad that I have posted this on other programming sites, I am only doing so because I have gotten zero answers anywhere else.
Last edited on
Hey, I'm also working on binary trees.

You should look into what kinds of tree you want to use. You could use a standard binary tree, an AVL tree, a Red-Black tree, a 2-3 tree... the list goes on. This determines how and where the information is stored in the tree.

Also, for searching, you'll need to look into traversal algorithms. The most popular are Prim's, Kruskal's and Dijkstra's algorithms.

Hope I was of some help,
Matt
Topic archived. No new replies allowed.