Skip to content

JA4. Binary Trees

Statement

The Learning Journal is a tool for self-reflection on the learning process. In addition to completing directed tasks, you should use the Learning Journal to document your activities, record problems you may have encountered and to draft answers for Discussion Forums and Assignments.

Your learning journal entry must be a reflective statement that considers the following questions

1. Describe what you did. This does not mean that you copy and paste from what you have posted or the assignments you have prepared. You need to describe what you did and how you did it

  • This was the fourth week of this course, it talked about the tree data structure, the binary tree in particular.
  • I started the week trying out the self-quiz, and I got 0 at first try, the topic was completely new to me.
  • I then read some of the required readings; unfortunately, I was not able to read all of them due to personal circumstances and time constraints.
  • I am expecting an extra bank holiday next week, I should be able to catch up with the readings then and also prepare for the quiz later in the week.
  • I also did the discussion assignment which was about summarizing the terminology of the binary tree data structure.
  • I later did the programming assignment which was about implementing interactive program that wraps a binary search tree.

2. Describe your reactions to what you did

  • The reading was super complex, I read the chapter 3 and 4 from the Barnett and Del Tongo book like three times, and I still don’t understand it fully.
  • The Shaffer book was a bit easier to understand, but I still need finish reading the chapter.
  • The discussion assignment was easy, but the programming assignment took me around 10 hours to complete.

3. Describe any feedback you received or any specific interactions you had. Discuss how they were helpful

  • I received feedback from my classmates on the unit 3 programming assignment, two of them was very helpful was good and gave me 90s but the third one failed me.
  • I worked around 12 hours on that assignment, and -in my opinion- produced a piece of art, but the grader failed me because it did not work on his machine using the Jeliot program.
  • I specifically stated in the assignment the environment that I tested my program on, and I also provided a screenshot of the output of my program and a compiled version along the source code, and yet I got failed.

4. Describe your feelings and attitudes

  • I feel frustrated, I worked hard on the assignment, and I got failed, but nonetheless, I learned a lot from it, not just about the Stacks/Queues, but also about the Java language and producing clean, readable, and maintainable code.
  • I am also annoyed by the fact that I have to use the Jeliot program to test my code, it is a very old program, and it does not work on my machine. I have an M2 chip processor, which neither supports the Jeliot program nor a virtual machine that can run it.

5. Describe what you learned

  • I learned about the binary tree data structure, and the terminology associated with it.
  • I learned about the different approaches to keep the tree balanced and how each technique has its pros and cons that even resulted in the creation of new data structures.
  • I learned about traversing the tree in different ways, and how to implement them in Java.
  • I also learned some general concepts about the Java language, including enums, Scanner class, and how to convert values between enum/string/int types.

6. What surprised me or caused me to wonder?

  • I coded in TypeScript my entire career (around 5 years now), and used the enum type a lot, but I’m surprised that Java requires you to explicitly convert string to enum and vice versa, while TypeScript does that automatically.
  • My imagination about a tree and edges was completely different knowing that it is an abstract data structure and the computer does not actually draw a tree on the screen.

7. What happened that felt particularly challenging? Why was it challenging to me?

  • The entire chapter was very challenging -relatively to the previous chapters-.
  • It took me a while to understand the difference between the height and depth of a tree, vs the height and depth of a node and how to calculate them.

8. What skills and knowledge do I recognize that I am gaining?

  • The fact that trees are just a different organization to a set of elements that can be represented in any other way -less complex- is very interesting to me.
  • Applying the few rules, constraints, and requirements of the binary search tree allowed to cut off the time complexity of the search operation from O(n) to O(log n) which is a huge improvement.

9. What am I realizing about myself as a learner?

  • I am realizing that I am a slow reader where I have to read the same paragraph multiple times to understand it.
  • I realized that if I don’t write down what I am learning, I will forget it very quickly.

10. In what ways am I able to apply the ideas and concepts gained to my own experience?

  • The difference between list, array, stack, queue, dictionary, and tree is very clear to me now.
  • Although I don’t use these concepts directly in my day-to-day work, I use tools all the time that are built on top of these concepts, and knowing how they work under the hood is very interesting to me.

11. Finally, describe one important thing that you are thinking about in relation to the activity

  • I am thinking about how to make the Jeliot program work on my machine.
  • I am also thinking how CLI (Command Line Interface) programs work under the hood, since I built a simple one for interacting with the binary search tree.

References

  • Shaffer, C. (2011). A Practical Introduction to Data Structures and Algorithm Analysis. Blacksburg: Virginia. Tech. https://people.cs.vt.edu/shaffer/Book/JAVA3e20130328.pdf. Chapter 5.
  • Barnett, G. & Del Tongo, L. (2008). Data Structures and Algorithms: An Annotated Reference with Examples. Chapter 3: Binary Search Tree and Chapter 4: Heaps.