Guessing Game – v1.0
This assignment was pretty exciting for me. We were asked to create a 20 Questions-like game, where the program could guess what object you were thinking of, using a binary tree . Binary Trees My teacher introduced me to a new concept called a binary tree. A binary tree consists of nodes, and each node contains a left and right child. For example, to the right, node A has node B as its left child and node C as its right child. This data structure is infinitely expandable and can hold a wide variety of data types. Saving & Reading Data This was definitely the toughest part of the project - saving the data in a plain text file. Using recursion, I was able to output the binary nodes relatively easily, using Preorder. This means that the nodes are printed out in this order: parent, left, right. For example, if you had "A" as the parent node, and "B" and "C" as its left and right nodes respectively, the output would be ABC. I used this method t