原创 leetcode 228:Summary Ranges

leetcode 228:Summary Ranges 題目: Given a sorted integer array without duplicates, return th

原创 leetcode 202:Happy number

題目: Write an algorithm to determine if a number is “happy”. A happy number is a number defined by the following proces

原创 leetcode 203:Remove Linked List Elements

題目: Remove all elements from a linked list of integers that have value val. Example Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5

原创 leetcode 58:Length of Last Word

題目: Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last

原创 leetcode 155:Min Stack

題目: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) -- Push

原创 leetcode 198:House Robber

題目: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stas

原创 機器學習入門-各種名稱

        要開始下面的學習,首先必須瞭解機器學習的分類,根據不同的分類標準,我們會有不同的分類結果,這些名稱在以後的機器學習中我們總會遇到,不同類型的問題我們會有不同的解決辦法。        一、根據輸出空間劃分:        

原创 快速排序

今天學習了快速排序算法,實現了基本快速排序和三向切分快速排序,其中三向切分對於有大量重複數據的情況有很好的作用。 package Code; import java.util.Random; public class QuickSor

原创 leetcode 225:Implement Stack using Queues

題目: Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Remove

原创 leetcode 70:Climbing Stairs

題目: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps.

原创 leetcode 190:Reverse Bits

題目: Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 0000

原创 leetcode 205:Isomorphic Strings

題目: Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can

原创 leetcode 191:Number of 1 Bits

題目: Write a function that takes an unsigned integer and returns the number of ’1’ bits it has (also known as the Hammi

原创 leetcode 204:Count Primes

題目: Description: Count the number of prime numbers less than a non-negative number, n. 分析: 本題是要統計0~n的素數個數,這個要根據hint中

原创 leetcode 66:plus one

題目: Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such