summaryrefslogtreecommitdiff
path: root/AlgoDesignAndTechniqueEdxPython
AgeCommit message (Collapse)Author
2018-12-09Organize lottery done.Haidong Ji
It wasn't hard since I worked this out in Java first. Once again, I felt Python is really well designed and efficient.
2018-11-28Inversion count done!Haidong Ji
It was easy, since I did the hard work of working it out in Java first.
2018-11-23Improved QuickSort done!Haidong Ji
Easy after the Java version is finished.
2018-10-31Majority element done!Haidong Ji
Easy, after Java version. Note that don't use ++i or i++, use i = i + 1 instead.
2018-10-10Binary Search iterative approach done!Haidong Ji
Seems that recursive approach is better.
2018-10-08Binary search done!Haidong Ji
2018-10-03Maximize salary done!Haidong Ji
2018-09-28Maximize num of prize places done!Haidong Ji
Got the Java version work first. Then it's easy.
2018-09-19Covering segment complete.Haidong Ji
This is quite tricky. I read the forum and it helped https://courses.edx.org/courses/course-v1:UCSanDiegoX+ALGS200x+2T2017/discussion/forum/course/threads/5a427c497acf2d0810000713 In particular try_my_best's algorithm worked. But I need to de-dup and sort the list before feeding it to that algorithm, otherwise it won't pass all the tests!
2018-09-14Rebuilding Lenovo.Haidong Ji
Checking in the code.
2018-09-07max dot product doneHaidong Ji
aka maximize online ad revenue.
2018-09-07Fractional Knapsack doneHaidong Ji
2018-09-02Changing money algo done.Haidong Ji
2018-08-29Last digit of partial fib sums doneHaidong Ji
It was pretty easy, just reimplemting the algorithm I've finished with Java.
2018-08-28Last digit of Fib sum is done.Haidong Ji
2018-08-26More improvement: not calculating fib at all!Haidong Ji
Doing the first few in a spreadsheet (and properly label columns and rows) really helped.
2018-08-24Improved code by getting rid of array during fib calculationHaidong Ji
2018-08-23Done!Haidong Ji
I actually started implementing this in Java first, but ran into long int overflow issues. Decided to get it working in Python first. I'm glad it worked! Now back to implement it in Java!
2018-08-19Great LCM exercise. Done!Haidong Ji
2 things are really interesting: 1. How to find the right test cases. I think I'll probably need to go back and re-read how to do an exhautisive testing 2. Python 3's floor division versus true division (// and /) operators are interesting. This exercise discussion helped me: https://courses.edx.org/courses/course-v1:UCSanDiegoX+ALGS200x+2T2017/discussion/forum/course/threads/5a3d32d644a15008df00062e and this one: https://stackoverflow.com/questions/19507808/python3-integer-division and this one: https://www.python.org/dev/peps/pep-0238/
2018-08-19GCD done!Haidong Ji
2018-08-16Fib last digit done. Yay!Haidong Ji
Bonus: figured PyDev TDD code generation issue. I created "sources" as a source folder, but really should have created as a package, for TDD code generation to work properly. Fixed now!
2018-08-13Week2 Python Fibonacci done!Haidong Ji
2018-08-07Python 3 implementation of max pairwise product!Haidong Ji
2018-07-28Added .gitignoreHaidong Ji
2018-07-28Initial commit.Haidong Ji