原创 leetcode -- 106. Construct Binary Tree from Inorder and Postorder Traversal

題目描述 題目難度:Medium Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume t

原创 leetcode -- 114. Flatten Binary Tree to Linked List

題目描述 題目難度:Medium Given a binary tree, flatten it to a linked list in-place. For example, given the following tree:

原创 leetode -- 113. Path Sum II

題目描述 題目難度:Medium Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given

原创 【轉】徹底理解0-1揹包問題

轉載自:https://blog.csdn.net/chanmufeng/article/details/82955730 0-1揹包問題 0-1揹包問題指的是每個物品只能使用一次 遞歸方法 public class KnapS

原创 2019.4.12 廣聯達實習生筆試 -- 最大面積

題目描述 如圖,有一塊麪積很大的地,這塊地已經被劃分爲了無數個1x1的方塊, 現在,我們商定了一種圈定方法:以任意一個方塊的頂點爲圓心畫一個圓,圓中所有的完整小方塊就是屬於你的土地,如果所畫的圓半徑爲N(N爲整數),請問能圈到多少

原创 leetcode -- 714. Best Time to Buy and Sell Stock with Transaction Fee

題目描述 題目難度:Medium Your are given an array of integers prices, for which the i-th element is the price of a given sto

原创 劍指offer -- 矩陣覆蓋

題目描述 我們可以用21的小矩形橫着或者豎着去覆蓋更大的矩形。請問用n個21的小矩形無重疊地覆蓋一個2*n的大矩形,總共有多少種方法? AC代碼 public class Solution { public int Rec

原创 劍指offer -- 字符串的排列

題目描述 輸入一個字符串,按字典序打印出該字符串中字符的所有排列。例如輸入字符串abc,則打印出由字符a,b,c所能排列出來的所有字符串abc,acb,bac,bca,cab和cba。 輸入描述: 輸入一個字符串,長度不超過9

原创 劍指offer -- 判斷一棵樹是否爲平衡二叉樹

題目描述 輸入一棵二叉樹,判斷該二叉樹是否是平衡二叉樹。 AC代碼 public class Solution { public boolean IsBalanced_Solution(TreeNode root) {

原创 java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries.

如何解決winutils.exe的問題 什麼原因導致的???windows是客戶端,讀取linux的文件。客戶端沒有hadoop的環境 重新在windows上面編譯hadoop,編譯出來window版本的客戶端。 解決辦法: 下載

原创 【轉】Ubuntu16.04 關閉和開啓圖形界面

轉載自:https://blog.csdn.net/zw__chen/article/details/86621103 關閉用戶圖形界面,使用tty登錄。 sudo systemctl set-default multi-user.t

原创 leetcode -- 122. Best Time to Buy and Sell Stock II

題目描述 題目難度:Easy Say you have an array for which the ith element is the price of a given stock on day i. Design an algo

原创 給定入棧順序,輸出所有可能出棧情況及所有情況的總數

代碼借鑑自:https://blog.csdn.net/qq_42194192/article/details/82717888 import java.util.*; public class Test{ static

原创 leetcode -- 946. Validate Stack Sequences

題目描述 題目難度:Medium Given two sequences pushed and popped with distinct values, return true if and only if this could ha

原创 迷宮尋路

題目描述 假設一個探險家被困在了地底的迷宮之中,要從當前位置開始找到一條通往迷宮出口的路徑。迷宮可以用一個二維矩陣組成,有的部分是牆,有的部分是路。迷宮之中有的路上還有門,每扇門都在迷宮的某個地方有與之匹配的鑰匙,只有先拿到鑰匙才能打