### Blogroll

### Topics

- Array and linked list
- Backtrack
- Binary search
- Bit operation
- C++
- Complexity
- Divide and Conquer
- Dynamic programming
- File operation
- Geometry
- Graph
- Greedy algorithm
- Hashtable and Map
- Heap
- JAVA
- Large scale data
- Number trick
- Object orientated design
- Probability
- Recursive
- Stack and Queue
- String
- Threads and locks
- Tree
- Uncategorized

### Archives

# Author Archives: askmecode

## Median of Two Sorted Arrays

There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)). C++: 01 double kSmall(int A[],int m,int B[],int n,int k) 02 { … Continue reading

Posted in Array and linked list, Binary search
Leave a comment

## Longest Palindromic Substring

Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longest palindromic substring. C++: 01 class Solution { 02 public: 03 string longestPalindrome(string s) { 04 … Continue reading

Posted in Array and linked list, String
Leave a comment

## ZigZag Conversion

The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility) P A H N A P L S I I G … Continue reading

Posted in Array and linked list, String
Leave a comment

## String to Integer (atoi)

Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input cases. Notes: It is intended for this problem to be … Continue reading

Posted in Number trick, String
Leave a comment

## Regular Expression Matching

Implement regular expression matching with support for ‘.’ and ‘*’. ‘.’ Matches any single character. ‘*’ Matches zero or more of the preceding element. The matching should cover the entire input string (not partial). The function prototype should be: bool isMatch(const char *s, … Continue reading

Posted in Recursive, String
Leave a comment

## Container With Most Water

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). Find two lines, which together with x-axis forms a container, such that the container … Continue reading

Posted in Array and linked list, Greedy algorithm
Leave a comment

## Integer to Roman

Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. C++: 01 class Solution { 02 public: 03 string intToRoman(int num) { 04 // Start typing your … Continue reading

Posted in Number trick, String
Leave a comment