Live data from Hacker News

Big-O Algorithm Complexity Cheat Sheet

bigocheatsheet.com

11–20 of 136 posts

Re: Big-O Algorithm Complexity Cheat Sheet

#11
post #9

This is a pretty limited list of algorithms. It should definitely include linear time sorting algorithms (e.g. bucket or radix sort), as well as graph algorithms (shortest path at least, but also probably all pair shortest path and minimum spanning tree). There should also be a section about heaps and their operations. There are a huge number of ways to implement a heap (e.g. linked list, binary tree, or a more exoti…

This sounds like a Wikipedia Subportal. If you want help building it, let me know.

Re: Big-O Algorithm Complexity Cheat Sheet

#12

Slightly academic, but this cheat sheet gives out some shorthand explanations to many of the methods in the Big-O document: http://www.scribd.com/doc/39557873/Data-Structures-Cheat-She...

>To download or read the full version of this document you must become a Premium Reader.

Re: Big-O Algorithm Complexity Cheat Sheet

#13
post #4

You can pass some interviews by blindly memorizing, but it's unnecessary. If you understand a concept, then you can reason its big O. Memorization implies a superficial understanding that may be revealed later. If you don't understand something, spend a few hours and implement it. "I hear and I forget. I see and I remember. I do and I understand." - Confucious

This was my immediate reaction. It is very easy and common for an interviewer to make a subtle change to how a common data structure or algorithm would work and then ask for complexity. Ex: Changing the quicksort pivot selection method.

Re: Big-O Algorithm Complexity Cheat Sheet

#15
I don't know why people don't use balanced BST ( std::map in c++) for storing the adjacency lists of a graph. Sure the insertion would take O(log n) time but , I think the overall benefit would be greater than the costs. Correct me if I am wrong.

Re: Big-O Algorithm Complexity Cheat Sheet

#16

Slightly academic, but this cheat sheet gives out some shorthand explanations to many of the methods in the Big-O document: http://www.scribd.com/doc/39557873/Data-Structures-Cheat-She...

>To download or read the full version of this document you must become a Premium Reader.

WHAT! I'm sorry about that. It's on my own website now: http://playground.omershapira.com/Notes/DS_CS.pdf

Re: Big-O Algorithm Complexity Cheat Sheet

#17
post #6

This is why it's a terrible idea to ask for some random algorithm runtime in an interview. It says absolutely nothing about programming or reasoning skill. I'd rather ask a candidate to explain their favorite data structure to me and derive it's big-O complexity right then and there. Being able to regurgitate the correct answer doesn't count for anything in my book.

Often the followup question to what is the O notation of X is why? So if you are just going to memorize the cheat sheet then it won't get you very far.

It is good to know what you should know about though.

Re: Big-O Algorithm Complexity Cheat Sheet

#20
post #15

I don't know why people don't use balanced BST ( std::map in c++) for storing the adjacency lists of a graph. Sure the insertion would take O(log n) time but , I think the overall benefit would be greater than the costs. Correct me if I am wrong.

[deleted]
Post reply on HN