原创 替換空格:

替換空格: 一含有空格的字符串,將字符串使用%20替代,“We are happy”,輸出爲:”We%20are%20happy” package 劍指offer; public class Test042 { pub

原创 Java之"=="和equals的區別

轉自:http://blog.csdn.net/qq_33406883/article/details/52180154 一、java當中的數據類型和“==”的含義: 基本數據類型(也稱原始數據類型) :byte,short,c

原创 CircleList_2

Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull. Follow up: Can you

原创 MergeTwoSortedList

合併兩個有序鏈表: package leetcode; import java.util.List; public class MergeTwoSortedList { public ListNode MergeTwoS

原创 Leetcode 81 Search in Rotated Sorted Array II

Leetcode 81 Search in Rotated Sorted Array II 題目來源:https://leetcode.com/problems/search-in-rotated-sorted-array-ii

原创 Two Sum和Three Sum

Two Sum和Three Sum 1.Given an array of integers, return indices of the two numbers such that they add up to a specif

原创 sort_List

1.Sort a linked list in O(n log n) time using constant space complexity. 使用合併排序對單鏈表進行排序,時間複雜度爲O(nlogn),使用插入排序對單鏈表進行

原创 Circle_List

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

原创 Count and Say

Count and Say The count-and-say sequence is the sequence of integers with the first five terms as following: 1.

原创 remove-nth-node-from-end-of-list

Given a linked list, remove the n th node from the end of list and return its head. For example, Given linked li

原创 155. Min Stack

155. Min Stack 題目鏈接:https://leetcode.com/problems/min-stack/description/ Design a stack that supports push, pop, to

原创 Record_List

Recorder_List https://www.nowcoder.com/questionTerminal/3d281dc0b3704347846a110bf561ef6b Given a singly linked li

原创 LeetCode 35 Search Insert Position

LeetCode 35 Search Insert Position 題目來源:https://leetcode.com/problems/search-insert-position/description/ Given a

原创 Generate Parentheses卡特蘭數的應用:

卡特蘭數的應用: (1)n對括號正確匹配數目: 給定n對括號,求括號正確配對的字符串數,例如: 0對括號:[空序列] 1種可能 1對括號:() 1種可能 2對括號:()() (()) 2種可能 3對括號:((())) ()(())

原创 JAVA之堆內存和棧內存的區別

轉自http://blog.csdn.net/as02446418/article/details/47007975 Java把內存分成兩種,一種叫做棧內存,一種叫做堆內存 在函數中定義的一些基本類型的變量和對象的引用變量都是在