20,182,328 2019-2020-1 "Object-oriented programming and data structures" experiment eight report
Course: "Programming and Data Structures"
Class: 1823
Name: Zhangjing Hao
Student ID: 20182328
experiments Teacher: Johnny
experiment Date: 2019 X month X
Compulsory / Elective: Compulsory
1. Experimental content
1, reference materials PP16.1, complete implementation chain LinkedBinaryTree tree (getRight, contains, toString, preorder , postorder)
their implementation LinkedBinaryTree tested with JUnit or write their own driver class.
2, LinkedBinaryTree, implement the functions based on (in order, first order) a unique sequence of two 㕚 tree structure, such as given in sequence and subsequent HDIBEMJNAFCKGL ABDHIEJMNCFGKL, the tree constructed based on the drawings.
3, their own design and implement a decision tree.
4, the input infix expressions, using the tree to convert the postfix expression is infix and postfix expression and outputs the calculation results.
2. Experimental procedure and results
Experiment 1
complete binary tree implemented according to the code books, a write driver class tested.
Experiment 2
continued to practice in experiment 1, the first with the first order to determine what the root, root re-use in order to position the left and right subtrees find, and finally recursion.
Experiment 3
own design and implement a decision tree
Experiment 4
Construction of expression binary tree to achieve Experiment 4
3. Experimental problems encountered in the process and settlement process
- Question 1: Decision tree structure can switch it?
- Problem 1 Solution: Yes, but not necessary, because the result of the decision tree only two "yes" or "no".
Other (perception, thinking, etc.)
Once again, do a binary tree advanced experiments, although it will not start, but through online information or understand, and design a decision tree is not the beginning, I was looking for other students to help solve it, in short, the experiment sensation is still very difficult, it gives me considerable challenge.