88 karma · joined Jul 10, 2012 (14y ago) · 40 submissions
comment 6y ago · link · parent
comment 6y ago · link · parent
2. When I was going through Tim Roughgarden's Algorithms course and saw the derivation of runtime complexity for mergesort and finally understood/visualized what a logarithm actually did (in school it was just taught as some rote function to help you manipulate eqautions of the form y=b^x)
3. Learning how TCP works from the bottom up. I think the biggest aha moment was when the textbook I was reading explained the TCP algorithm as a state machine that's just running on the client and server machines with the rest of the underlying network just forwarding packets, i.e. "pushing the complexity to the edge of the network".
4. Working through the nand2tetris project resulted in a lot of "oh X is just basically this at its core"
5. When going through a textbook explaining how relational database engines were implemented and seeing that they're essentially just using disk-persisted hash tables and self-balancing search trees to build indices on columns and make `select`s O(1)/O(log) time (I wasn't taught this in my uni's database course and assumed there was some fancy magic going on to make queries fast)
6. Realizing that I could just do a form of graph search/dependency resolution when learning a new codebase/trying to understand how a function works. I think before seeing someone do this in front of me I would usually just panic at the thought of "thousands of lines of code" rather than just "keep iteratively diving into the functions being called". Whenever I'm learning a new language, the first thing I'll do is setup the LSP plugin in vim so that I can quickly navigate up and down call graphs. Tbh I don't understand how some developers claim to not need this and instead just manually grep+open file in order to "jump to definition".
7. Forcing myself to derive the rotation logic for AVL trees. I was curious if, given just the high level properties of how an AVL tree behaves in order to guarantee O(log) time lookups, if I would be able to figure out all the rotation cases. Was a very rewarding exercise and something I plan on writing a blog post about (eventually...)
(edit)
8. Learning about the log data structure and how state can be replicated by replaying/executing this stream of transformations/updates.
comment 12y ago · link · parent
The browsable problem archive is also in the same location: http://community.topcoder.com/tc?module=ProblemArchive.
comment 12y ago · link · parent
comment 12y ago · link · parent
My first serious introduction to algorithms was through Tim Roughgarden's 'Algorithms: Design and Analysis' course on Coursera. It's a nice formal introduction and really focuses on and builds an intuition for how to think about problem solving like a computer scientist. I'd also recommend Steven Skienna's Algorithm Design Manual as it's written in a similar style.
As mentioned earlier, the TopCoder Online Judge is a great tool to practice problems as well. I could never find a tutorial which covered how to effectively use TopCoder as a practice tool so I wrote one for my programming club: http://acx0.com/cpc/topcoder.html (note: the rest of my site is a complete mess right now)
Of course, there's tonnes of other resources out there but these would be my top recommendations so far.
comment 12y ago · link · parent
I realize I didn't exactly put a lot of time into practicing and learning new material, but now that I've graduated I'm hoping to practice more and eventually try raising my rating on TopCoder. If anything, training for ICPC drilled the basics of algorithms and data structures into my head and lead me to find tons of excellent resources for improving in these competitions (and consequently, programming/problem solving in general).
comment 14y ago · link · parent
comment 14y ago · link · parent
If you want to get started, try going through TopCoder's high school competition arena. The problems shouldn't be too bad if you have a good understanding of your languages stdlib and about basic data structures (alternatively, it's probably a great way to learn a new language's stdlib). You basically get a problem statement and just have to fill in a method that performs the computations required with the example inputs. Then you can test it against all the test cases once it passes the example outputs. UVa is similar, except you have to take input from a file and it doesn't tell you what test cases your solution fails on (more like the ACM ICPC style of questions).
I prefer TopCoder more since the focus is all on algorithms (UVa's problems will usually require taking input/producing output in very specific ways, which gets annoying sometimes), and since you can see the top ranked competitors' solutions for previous contents. It helps to review these after you solve a problem to pick up little tricks.
[0] (http://www.topcoder.com/tc) - click the O(n) icon in the top left to start the arena applet. Then go to "Practice Rooms" -> "TCHS" or "SRM" and pick a room. Within each room there should be 3 problems valued based on difficulty.
[1] (http://uva.onlinejudge.org/) - go to "Browse Problems" to view them all, but I find http://uhunt.felix-halim.net/ more useful; just enter your username and it'll suggest problems for you to do next (based on increasing difficulty)
comment 14y ago · link · parent
If you want to try it out just run the following commands:
git clone git://github.com/acx0/etc.git ~/etc
cd ~/etc
git submodule update --init # my link script is in a separate repository so it's a submodule in my dotfile repo
cd link.sh
./link.sh # this will show the status of any conflicting files
./link.sh -b # backup any conflicting files
./link.sh -wf # force write (symlink) my set of config files
And everything's set up. If you want to install the vim plugins I use, just run vim -c 'BundleInstall'
and let Vundle download the plugins (you have to restart vim to use the plugins).Then when you're ready to restore your ~/ back to its original state, run
./link.sh -r # restore any configs that were backed up
which also takes care of deleting the configs you didn't have (so if you backed up with no conflicting files (backup dir empty), and then restore, it'll just remove all the existing symlinks)If you didn't run the backup command, you can simply run
./link.sh -d
to delete the symlinks for all the files in the repo. Then just remove any traces of the repo with 'rm -rf ~/etc'.