Clone Graph Part I

May 30, 2012 at 10:42 am in Uncategorized by 1337c0d3r · 5 Comments »

Clone a graph. Input is a Node pointer. Return the Node pointer of the cloned graph.

Palindrome Number

Jan 4, 2012 at 11:18 pm in Uncategorized by 1337c0d3r · 34 Comments »

Determine whether an integer is a palindrome. Do this without extra space.

Longest Palindromic Substring Part II

Nov 20, 2011 at 11:07 pm in string by 1337c0d3r · 40 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.

Longest Palindromic Substring Part I

at 7:04 am in dynamic programming, string by 1337c0d3r · 32 Comments »

Given a string S, find the longest palindromic substring in S.

Regular Expression Matching

Sep 1, 2011 at 2:47 am in backtracking, string by 1337c0d3r · 35 Comments »

Implement regular expression matching with support for ‘.’ and ‘*’.

Insert into a Cyclic Sorted List

Aug 12, 2011 at 9:28 pm in linked list by 1337c0d3r · 38 Comments »

Given a node from a cyclic linked list which has been sorted, write a function to insert a value into the list such that it remains a cyclic sorted list. The given node can be any single node in the list.

Reverse Bits

Aug 6, 2011 at 3:16 pm in bit operations by 1337c0d3r · 17 Comments »

Reverse bits of an unsigned integer.

Lowest Common Ancestor of a Binary Tree Part II

Jul 21, 2011 at 7:28 am in binary tree by 1337c0d3r · 11 Comments »

Given a binary tree, find the lowest common ancestor of two given nodes in the tree. Each node contains a parent pointer which links to its parent.

Lowest Common Ancestor of a Binary Tree Part I

Jul 18, 2011 at 6:12 pm in binary tree by 1337c0d3r · 19 Comments »

Given a binary tree, find the lowest common ancestor of two given nodes in the tree.

Lowest Common Ancestor of a Binary Search Tree (BST)

Jul 17, 2011 at 3:24 am in binary tree by 1337c0d3r · 10 Comments »

Given a binary search tree (BST), find the lowest common ancestor of two given nodes in the BST.