Tags » Brute Force

Rabin - Karp Algorithm :


In computer science, the Rabin–Karp algorithm or Karp–Rabin algorithm is a string searching algorithm created by Richard M. Karp and Michael O. Rabin that uses hashing to find any one of a set of pattern strings in a text. 550 more words

Algorithm

Brute Force

Picture this, you are in prison, and that already sucks pretty hard, and you have this warden or prison guy in charge or whatever, and he is a complete nut case, real little man syndrome idiot. 225 more words

Time complexity analysis for the 3-sum/4-sum problem

The 3-Sum problem is defined as follows: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? 1,150 more words

Programming

Find container with most water

I’ve recently worked on an interesting problem: Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). 366 more words

Programming