

We are given a sequence of n numbers a1, …, an we will assume that all the numbers are distinct.

A natural method would be to label the movies from 1 to n according to your ranking, then order these labels according to the stranger’s ranking, and see how many pairs are “out of order.” More concretely, we will consider the following problem. Let’s consider comparing your ranking and a stranger’s ranking of the same set of n movies. But what’s a good way to measure, numerically, how similar two people’s rankings are? Clearly an identical ranking is very similar, and a completely reversed ranking is very different we want something that interpolates through the middle region. You rank a set of rt movies, and then a collaborative filtering system consults its database to look for other people who had “similar” rankings. Another application arises in recta-search tools on the Web, which execute the same query on many different search engines and then try to synthesize the results by looking for similarities and differences among the various rankings that the search engines return.Ī core issue in applications like this is the problem of comparing two rankings. Once the Web site has identified people with “similar” tastes to yours - based on a comparison of how you and they rate various things - it can recommend new things that these other people have liked. For example, a number of sites on the Web make use of a technique known as collaborative filtering, in which they try to match your preferences (for books, movies, restaurants) with those of other people out on the Internet. We will consider a problem that arises in the analysis of rankings, which are becoming important to a number of current applications.

It is therefore faster than the classical algorithm, which requires n² single-digit products. It is a divide and conquer algorithm which works in O(nlogn) time.ħ - Karatsuba algorithm for fast multiplication: It does multiplication of two n-digit numbers in at most 3n^(log 3) single-digit multiplications in general (and exactly n^(log3) when n is a power of 2). Strassen’s algorithm multiplies two matrices in O(n².8974) time.Ħ - Cooley–Tukey Fast Fourier Transform (FFT) algorithm is the most common algorithm for FFT. A simple method to multiply two matrices need 3 nested loops and is O(n³). The Divide and Conquer algorithm solves the problem in O(nLogn) time.ĥ - Strassen’s Algorithm is an efficient algorithm to multiply two matrices. The problem can be solved in O(n²) time by calculating distances of every pair of points and comparing the distances to find the minimum. The algorithm divides the array in two halves, recursively sorts them and finally merges the two sorted halves.Ĥ - Closest Pair of Points: The problem is to find the closest pair of points in a set of points in x-y plane. Finally, the algorithm recursively sorts the subarrays on left and right of pivot element.ģ - Merge Sort is also a sorting algorithm. The algorithm picks a pivot element, rearranges the array elements in such a way that all elements smaller than the picked pivot element move to left side of pivot, and all greater elements move to right side. Otherwise, if x is less than the middle element, then the algorithm recurs for left side of middle element, else recurs for right side of middle element.Ģ - Quicksort is a sorting algorithm. If the values match, return the index of middle. In each step, the algorithm compares the input element x with the value of the middle element in array. Combine: Appropriately combine the answersįollowing are some standard algorithms that are Divide and Conquer algorithms:ġ - Binary Search is a searching algorithm.Conquer: Recursively solve these subproblems.Divide: Break the given problem into subproblems of same type.A very popular algorithmic paradigm, a typical Divide and Conquer algorithm solves a problem using following three steps:
