原创 leetcode #160 in cpp

Write a program to find the node at which the intersection of two singly linked lists begins. For example, the follo

原创 leetcode #141 in cpp

Given a linked list, determine if it has a cycle in it. Follow up: Can you solve it without using extra space? Sol

原创 Leetcode #143 in cpp

Given a singly linked list L: L0→L1→…→Ln-1→Ln, reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place with

原创 leetcode #145 in cpp

Solution: The post-order is the reverse of the root->right->left order. The root->right->left order is similar to pre-o

原创 leetcode #151 in cpp

Solution: 1. reversed the whole string 2. reversed each word in the reversed string. 3. remove multiple space between w

原创 leetcode #152 in cpp

Find the contiguous subarray within an array (containing at least one number) which has the largest product. For exa

原创 leetcode #149 in cpp

Given n points on a 2D plane, find the maximum number of points that lie on the same straight line. Solution:   three