You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implementation of Optimal Binary Search Tree with the use of dynamic programming, written in Python.
4
+
5
+
## Main problem
6
+
The main focus is to implement OBST with use of dynamic programming (no recursion) based on the dictionary.txt file that contains list of English words with their frequency.
7
+
8
+
Accepted words for the tree are words with frequency > 50k and we are taking the words in alphabetical order.
9
+
10
+
## Subproblems
11
+
### Number of comparisons
12
+
In the numOfComparisons.py there is implemented function to find the number of needed comparisons for finding the word. One comparison == one level of the tree.
13
+
14
+
Number of comparisons for the root is equal to one.
15
+
16
+
## Running the program
17
+
After running the program, first the tree gets printed out to the console (first 10 levels). Then the program waits for user input to enter the word to find answer for Number of comparisons subproblem.
18
+
19
+
To run the program, execute the following command:
0 commit comments