summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-02-16Build heap done!Haidong Ji
1. Modifying code so it's easy to test is always worth it! Easier to identify the next concrete steps and carry them out! 2. Hand build a few arrays helped my understanding.
2019-01-29Network packet processing done!Haidong Ji
Oh man, I spent so much time on this, on and off for more than 16 hours. But it was worth it in the end! Initially I didn't even noticed that there is a "what to do" part in exercise file, so I started coding following my own intuition, which wasn't too bad. I felt like I was going places and passed a few tests but failed one or two test cases. That's when things started getting difficult. I tried thinking, paper/pencil, sleeping on it, and reading forums (coursera, edx has no discussion on this when I worked on it). I then realized the "what to do" part in exercise and started following it. I should have stashed my code based on my own intuition, but I didn't. I'm learning, after all. Then my code got really messy. I added a lot of if statements and temp variables to get by, but it consistently fails on grader test case 20. That test case input is from a file, so far I haven't learned proper way of reading file as input in junit, so I started simplify my code hoping that I can pass. In the end my code simplification did work and passed the grader, but I really should learn how to use file input in JUnit, or how to feed input file. Eclipse makes that easy, but not IDEA, at least not the version of 2018.2. 2018.3 supposedly has it, but I don't know how to upgrade it safely on my Manjaro yet. Woohoo, fun stuff!
2019-01-23Interim checkin. Network packet processing not done yet.Haidong Ji
2019-01-08Tree height non-recursive version done!Haidong Ji
Yay!!! I got rid of the recursion and used an iterative function to calculate height. The trick used was to use a queue. It turned out to be faster and consumed less memory. Fun stuff and I'm happy :)
2019-01-07Tree height recursive version done!Haidong Ji
Following example starter code, I had to specify stackSize when creating the thread. Without it, it won't pass tests due to stack overflow error. I'll still try to work out an iterative version using Queue. We'll see.
2019-01-01Check bracket done!Haidong Ji
Switching from Eclipse to Jetbrains IDEA, still using TDD methods. So far not bad. I like the fact that by using different IDEs, I can see what kind of help the IDE provides (coding style, best practices, etc.). That can be helpful.