Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class PrefixTree {
- private PrefixTree left;
- private PrefixTree rigth;
- private char character;
- public PrefixTree(PrefixTree left, PrefixTree rigth, char character) {
- this.left = left;
- this.rigth = rigth;
- this.character = character;
- }
- public void print() {
- System.out.print(this.character);
- if (this.left != null) {
- this.left.print();
- }
- if (this.rigth != null) {
- this.rigth.print();
- }
- }
- public static void main(String[] args) {
- // 1. Распечатать дерево из задания
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement