原创 【Leetcode長征系列】 Divide Two Integers
原題: Divide two integers without using multiplication, division and mod operator. 思路: 記錄除數與被除數的符號判斷結果的符號。處理除數與被除數的絕對值。我
原创 【Leetcode長征系列】Insertion Sort List
原題: Sort a linked list using insertion sort. 【知識回顧】 插入排序: 從第一個元素開始,該元素可以認爲已經被排序;取出下一個元素,在已經排序的元素序列中從後向前掃描;如果該元素(已排序)大於
原创 【Leetcode長征系列】Plus One
原題: Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such
原创 【Leetcode長征系列】Remove Duplicates from Sorted List II
原題: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinct numbers from the or
原创 【Leetcode長征系列】Valid Parentheses
原題: Given a string containing just the characters '(', ')','{','}', '[' and ']', determine if the input string is valid
原创 Reverse Linked List
Reverse a singly linked list. 解析: /** * Definition for singly-linked list. * struct ListNode { * int val; *
原创 【Leetcode長征系列】Construct Binary Tree from Preorder and Inorder Traversal
原題: Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates
原创 Rotate Array
Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] i
原创 【Leetcode長征系列】Single Number II
原題: Given an array of integers, every element appears three times except for one. Find that single one. Note: Your alg
原创 Maven學習資源
學習parquet過程中發現這尼瑪和以前搭的架構都好不一樣啊不是靠配置的是要用maven編譯的! 所以就又開始學習maven的漫漫長路… 它官網裏的解釋我沒太明白,官網裏的樣例也失敗了,總之就是在自己找野路子學習了。而且現在發現真的是得自
原创 【Leetcode長征系列】Letter Combinations of a Phone Number
原題: Given a digit string, return all possible letter combinations that the number could represent. A mapping of digi
原创 c++數據類型
char -128 ~ +127 (1 Byte) short -32767 ~ + 32768 (2 Bytes) unsigned short 0 ~ 655
原创 【Leetcode長征系列】Convert Sorted Array to Binary Search Tree
原題: Given an array where elements are sorted in ascending order, convert it to a height balanced BST. 【複習時間】:平衡二叉樹(Bal
原创 【Leetcode長征系列】Merge k Sorted Lists
原題: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 思路:兩條兩條地合併。時間複雜度
原创 【Leetcode長征系列】Construct Binary Tree from Inorder and Postorder Traversal
原題: Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates