繼續刷題
按照慣例,請ChatGPT幫我根據學習範圍出題,二元樹、BST、Tree Sort、Quick Sort、Merge Sort主題的LeetCode題...
這題是常見的二元樹問題,給兩個不同遍歷順序 (中序遍歷和後序遍歷)構建對應的二元樹。
思路:先理解中序和後序遍歷的特色:中序遍歷是左子樹 -> 根節點 -...
876. Middle of the Linked List
tags: Easy、Linked List
Given the head of a singl...
原文題目
Given an array of strings strs, group the anagrams together. You can return...
原文題目You are given an m x n grid where each cell can have one of three values:...
1046. Last Stone Weight
題目描述
有一堆石頭,每塊石頭的重量都是正整數。
每次挑出兩塊最重的石頭,互相撞擊:
如果兩塊石頭的重量相等...