Graphs

Given below are 5 friends and how they are connected. If I ask you to find the shortest path for Peter to reach Tom then you will immediately answer that he should go through Sachin [Peter -> Sachin -> Tom]. It requires some effort if you want to make the computer answer the same question.…

Trees

Take a look at the org chart of a startup company. There are 7 employees in the company. Each employee can have up to 2 other employees reporting to them. Tree is a data structure which is used to represent this information in computer’s memory. Using the org chart let us understand the vocabulary used in…

Amazon knows what I like

I buy a lot of books from amazon.com. You can view my online bookshelf here. One of the reasons I like amazon.com is because of its recommendations engine. Few days back it recommended me the book Thinking Fast and Slow. It is one of my favorite books. It not only recommended the book but it also…

Tf-Idf and Cosine similarity

In the year 1998 Google handled 9800 average search queries every day. In 2012 this number shot up to 5.13 billion average searches per day. The graph given below shows this astronomical growth. Year Average Search per day 1998 9800 2000 60000000 2007 1200000000 2008 1745000000 2009 2610000000 2010 3627000000 2011 4717000000 2012 5134000000 The…

Netflix knows what I like

I am a Netflix subscriber. Every time I go to their site it will recommend movies I might like. Most of the times its recommendations are very good. How does it know what I like? I do not know how the actual algorithm is implemented. But I know some of the basic concepts behind this.…

Non Personalized Recommenders

In non personalized recommenders everyone gets to see the same recommendation. The site does not know who you are. If I go to amazon.com as an anonymous user it shows items that are currently viewed by other members. This is one example of a non personalized recommendation. There are two variations in this – Predictions…

Hash Table

Given below is the information about employees in a software company. The company has 100 employees. Id Name Date of Birth 1 Tom 10-Nov-1980 2 Peter 12-Oct-1981 3 Alex 08-Jun-1979 … 100 Jian 10-Jan-1977 If you know the employeeId how fast can you retrieve their information? If we store all the employee information in an…