Clone Graph Part I
May 30, 2012 at 10:42 am in Uncategorized by 1337c0d3r · 29 Comments »
May 30, 2012 at 10:42 am in Uncategorized by 1337c0d3r · 29 Comments »
Jan 4, 2012 at 11:18 pm in Uncategorized by 1337c0d3r · 65 Comments »
Nov 20, 2011 at 11:07 pm in string by 1337c0d3r · 67 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 · 45 Comments »
Sep 1, 2011 at 2:47 am in backtracking, string by 1337c0d3r · 65 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 · 24 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 · 69 Comments »
May 16, 2011 at 3:39 am in string by 1337c0d3r · 49 Comments »
May 12, 2011 at 2:27 am in Uncategorized by 1337c0d3r · 23 Comments »
Apr 20, 2011 at 4:30 am in binary tree by 1337c0d3r · 49 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 · 94 Comments »
Feb 9, 2011 at 3:24 am in dynamic programming by 1337c0d3r · 47 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 · 76 Comments »
Jan 25, 2011 at 7:25 pm in Uncategorized by 1337c0d3r · 62 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
newbie on A Distance Maximizing Problem
Use stack to solve this problem is much easier:public int maxDistance(int[] A) { ...newbie on A Distance Maximizing Problem
Use stack to solve this problem is much easier:public int maxDistance(int[] A) { ...newbie on A Distance Maximizing Problem
We can use a stack to solve this problem, it's O(n) too:public int maxDistance(int[] ...shivali on Longest Palindromic Substring Part II
//edited://longest pa #include #include #define lsfor(i,a,b) for(i=a;i<b;i++)us...shivali on Longest Palindromic Substring Part II
//longest pallindrome in a string(c++) #include #include #define lsfor(i,a,b) for(i=a;...