Clone Graph Part I
May 30, 2012 at 10:42 am in Uncategorized by 1337c0d3r · 27 Comments »
May 30, 2012 at 10:42 am in Uncategorized by 1337c0d3r · 27 Comments »
Jan 4, 2012 at 11:18 pm in Uncategorized by 1337c0d3r · 63 Comments »
Nov 20, 2011 at 11:07 pm in string by 1337c0d3r · 62 Comments »
Given a string S, find the longest palindromic substring in S.
Note:
This is Part II of the article: Longest Palindromic Substring. Here, we describe an algorithm (Manacher’s algorithm) which finds the longest palindromic substring in linear time. Please read Part I for more background information.
at 7:04 am in dynamic programming, string by 1337c0d3r · 42 Comments »
Sep 1, 2011 at 2:47 am in backtracking, string by 1337c0d3r · 59 Comments »
Aug 12, 2011 at 9:28 pm in linked list by 1337c0d3r · 45 Comments »
Aug 6, 2011 at 3:16 pm in bit operations by 1337c0d3r · 26 Comments »
Jul 21, 2011 at 7:28 am in binary tree by 1337c0d3r · 23 Comments »
Jul 18, 2011 at 6:12 pm in binary tree by 1337c0d3r · 35 Comments »
Jul 17, 2011 at 3:24 am in binary tree by 1337c0d3r · 17 Comments »
May 19, 2011 at 2:10 am in Uncategorized by 1337c0d3r · 64 Comments »
May 16, 2011 at 3:39 am in string by 1337c0d3r · 42 Comments »
May 12, 2011 at 2:27 am in Uncategorized by 1337c0d3r · 22 Comments »
Apr 20, 2011 at 4:30 am in binary tree by 1337c0d3r · 47 Comments »
Apr 6, 2011 at 10:19 pm in binary search by 1337c0d3r · 23 Comments »
Note:
This is Part II of the article: The Painter’s Partition Problem. Please read Part I for more background information.
Apr 5, 2011 at 3:43 am in dynamic programming by 1337c0d3r · 19 Comments »
You have to paint N boards of length {A0, A1, A2 … AN-1}. There are K painters available and you are also given how much time a painter takes to paint 1 unit of board. You have to get this job done as soon as possible under the constraints that any painter will only paint continuous sections of board, say board {2, 3, 4} or only board {1} or nothing but not board {2, 4, 5}.
Mar 28, 2011 at 2:23 am in Uncategorized by 1337c0d3r · 88 Comments »
Feb 9, 2011 at 3:24 am in dynamic programming by 1337c0d3r · 46 Comments »
There are n coins in a line. (Assume n is even). Two players take turns to take a coin from one of the ends of the line until there are no more coins left. The player with the larger amount of money wins.
Jan 27, 2011 at 2:43 am in binary search by 1337c0d3r · 73 Comments »
Jan 25, 2011 at 7:25 pm in Uncategorized by 1337c0d3r · 59 Comments »
A long array A[] is given to you. There is a sliding window of size w which is moving from the very left of the array to the very right. You can only see the w numbers in the window. Each time the sliding window moves rightwards by one position. Following is an example:
The array is [1 3 -1 -3 5 3 6 7], and w is 3.
Window position [read more →]
Recent Comments
frank on Median of Two Sorted Arrays
The time complexity should be O(log(min(m,n))) instead of O(log(m+n)).frank on Median of Two Sorted Arrays
This is just a special case of case 2 in the "Find k-th smallest element". k = [m+n]/2 (n...ironmanz on Longest Palindromic Substring Part II
I agree with you.frank on Coins in a Line
Here is my c++ code.#include #include using namespace std;int genRand(int, ...frank on Find the k-th Smallest Element in the Union of Two Sorted Arrays
My algorithm always ensures the time complexity is O(lg(min(m,n,k))). Assuming m>=n, ...