原创 LeetCode_Sort Colors

Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, wi

原创 LeetCode_Subsets II

Given a collection of integers that might contain duplicates, S, return all possible subsets. Note: Elements in a s

原创 LeetCode_ValidPalindrome

Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For ex

原创 LeetCode_Set Matrix Zeros

Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. class Solution { public:

原创 LeetCode_Edit Distance

Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operatio

原创 LeetCode_Combinations

Given two integers n and k, return all possible combinations of k numbers out of 1 ... n. For example, If n = 4 and

原创 CareerCup_1_7

Write an algorithm such that if an element in an MxN matrix is 0, its entire row and column are set to 0. /* Write an

原创 CareerCup_1_4

Write a method to replace all spaces in a string with '%20'. You may assum

原创 LeetCode_Gray Code

The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative in

原创 LeetCode_Interleaving String

Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2. For example, Given:s1 = "aabcc",s2 = "

原创 CareerCup_1_6

Given an image represented by an NxN matrix, where each pixel in the image is 4 bytes, write a method to rotate the ima

原创 CareerCup_1_1

Implement an algorithm to determine if a string has all unique characters. What if you cannot use additional data struc

原创 LeetCode_Reverse Linked List II

Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4->5->NULL, 

原创 LeetCode_Restore IP Address

Given a string containing only digits, restore it by returning all possible valid IP address combinations. For exampl

原创 POSIX Threads Tutorial

Overview This is a brief tutorial on how write parallel applications using POSIX threads. Basically, this document is