歡迎來到軟體技術部落格,這裡是 React、JavaScript 及技術技能的知識文章頁面。無論是在尋找關於monorepo 的技術、zustand 的狀態管理技巧,還是希望加強對前端開發的理解,這裡都有豐富的資源。每篇文章都精心撰寫,旨在提供清晰、易於理解的內容,幫助大家快速找到所需資訊。從基本概念到進階技巧,無論是初學或是進階,這裡都有適合大家的內容。如果對於圖文式內容有興趣,也可以參考我們 Instagram。
[Leetcode] 0230. Kth Smallest Element in a BST
Given the root of a binary search tree, and an integer k, return the kth smallest value (1-indexed) of all the values of the nodes in the tree.
[Leetcode] 0098. Validate Binary Search Tree
Given the root of a binary tree, determine if it is a valid binary search tree (BST).
A valid BST is defined as follows:
The left subtree of a node contains only nodes with keys less than the node’s key.
The right subtree of a node contains only nodes with keys greater than the node’s key.
Both the left and right subtrees must also be binary search trees.
[Leetcode] 0105. Construct Binary Tree from Preorder and Inorder Traversal
Given two integer arrays preorder and inorder where preorder is the preorder traversal of a binary tree and inorder is the inorder traversal of the same tree, construct and return the binary tree.
[Leetcode] 0572. Subtree of Another Tree
Given the roots of two binary trees root and subRoot, return true if there is a subtree of root with the same structure and node values of subRoot and false otherwise.
A subtree of a binary tree tree is a tree that consists of a node in tree and all of this node’s descendants. The tree tree could also be considered as a subtree of itself.
[Leetcode] 0297. Serialize and Deserialize Binary Tree
Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or transmitted across a network connection link to be reconstructed later in the same or another computer environment.
Design an algorithm to serialize and deserialize a binary tree. There is no restriction on how your serialization/deserialization algorithm should work. You just need to ensure that a binary tree can be serialized to a string and this string can be deserialized to the original tree structure.
Clarification: The input/output format is the same as how LeetCode serializes a binary tree. You do not necessarily need to follow this format, so please be creative and come up with different approaches yourself.
美國半導體戰略大轉變!台積電 1650 億美元投資會如何改寫晶片市場?
台灣積體電路製造公司(TSMC,以下稱台積電)近日宣布將在美國設立第三座晶圓廠,並計劃投資 1650 億美元,在亞利桑那州建設先進封裝工廠及研發中心。這項重大投資不僅是台積電的商業擴展策略之一,更與國際政策和經濟發展息息相關。
這項投資將對全球晶片市場產生何種影響?台積電加碼美國到底有什麼利弊?對台灣的經濟與區域安全會帶來哪些衝擊?今天就來深入分析這項重大決策,並聊聊這個策略會對科技業產生什麼樣的改變!
[Leetcode] 0102. Binary Tree Level Order Traversal
Given the root of a binary tree, return the level order traversal of its nodes’ values. (i.e., from left to right, level by level).
[Leetcode] 0124. Binary Tree Maximum Path Sum
A path in a binary tree is a sequence of nodes where each pair of adjacent nodes in the sequence has an edge connecting them. A node can only appear in the sequence at most once. Note that the path does not need to pass through the root.
The path sum of a path is the sum of the node’s values in the path.
Given the root of a binary tree, return the maximum path sum of any non-empty path.
[Leetcode] 0951. Flip Equivalent Binary Trees
For a binary tree T, we can define a flip operation as follows: choose any node, and swap the left and right child subtrees.
A binary tree X is flip equivalent to a binary tree Y if and only if we can make X equal to Y after some number of flip operations.
Given the roots of two binary trees root1 and root2, return true if the two trees are flip equivalent or false otherwise.
[Leetcode] 0100. Same Tree
Given the roots of two binary trees p and q, write a function to check if they are the same or not.
Two binary trees are considered the same if they are structurally identical, and the nodes have the same value.
[Leetcode] 0271. Encode and Decode Strings
Design an algorithm to encode a list of strings to a string. The encoded string is then sent over the network and is decoded back to the original list of strings.
[Leetcode] 0647. Palindromic Substrings
Given a string s, return the number of palindromic substrings in it.
A string is a palindrome when it reads the same backward as forward.
A substring is a contiguous sequence of characters within the string.
[LeetCode] 0005. Longest Palindromic Substring
Given a string s, return the longest palindromic substring in s.
[Leetcode] 0125. Valid Palindrome
A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward. Alphanumeric characters include letters and numbers.
Given a string s, return true if it is a palindrome, or false otherwise.
[Leetcode] 0104. Maximum Depth of Binary Tree
Given the root of a binary tree, return its maximum depth.
A binary tree’s maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.
DeepSeek vs. OpenAI vs. Anthropic:誰的 AI 訓練效率更高?
人工智慧(AI)正在迅速改變我們的世界,無論是聊天機器人、語音助手,還是自動駕駛車輛,都依賴於強大的 AI 訓練和推理技術。但並不是所有 AI 模型的訓練方式都相同,一些公司選擇使用最先進的硬體,而另一些則嘗試用更少的資源達到相近的效果。
DeepSeek、OpenAI 和 Anthropic 是 AI 領域的三大競爭者,每家公司的訓練策略各有不同。DeepSeek 選擇使用較舊但成本較低的 A100 GPU,OpenAI 則倚賴最新的 NVIDIA H100,而 Anthropic 依靠 Google TPU 來優化 AI 訓練。本篇文章將深入探討這三家公司在 AI 訓練與推理上的策略,並分析它們對 AI 產業的影響,一起看下去吧!
單日股價暴跌?!NVIDIA 如何迎戰 DeepSeek的 AI 威脅?
DeepSeek 是誰?
DeepSeek 是一家來自中國的新創公司,近期以極低的成本開發出與 OpenAI GPT-4 競爭的 AI 模型。DeepSeek 的成功主要歸功於其創新的 AI 訓練方法,透過較舊的 NVIDIA A100 GPU 和低成本晶片組合,突破了高昂的 AI 訓練成本。
NVIDIA 的角色
NVIDIA 是全球 AI 硬體市場的領導者,高端 GPU 被廣泛應用於 AI 訓練與推理。過去 NVIDIA 幾乎是所有大型 AI 項目的核心供應商,企業必須依賴他們昂貴的 GPU 來訓練 AI 模型。
DeepSeek 與 NVIDIA 的關係
DeepSeek 目前仍然依賴 NVIDIA 的硬體來運行 AI 模型,但 DeepSeek 證明了 AI 訓練並不一定要使用 NVIDIA 最新的 H100 或 Blackwell 架構 GPU,這也讓市場開始重新思考 NVIDIA 高端硬體的必要性。
DeepSeek:AI 新勢力如何顛覆產業格局
近年來,人工智慧(AI)領域的競爭越來越激烈,各國科技公司紛紛投入資源,試圖搶占市場先機。在這場 AI 競賽中,DeepSeek(深度求索)憑藉低成本、高效率的技術方案迅速崛起,成為市場關注的焦點。相較於 OpenAI、Anthropic 等美國科技公司,DeepSeek 不僅展現出強大的技術創新能力,還顛覆了人們對於 AI 訓練成本的既有認知。
本篇文章將深入探討 DeepSeek 的崛起,並從多個角度分析其技術優勢、核心競爭力,以及對AI產業的啟發,一起看下去吧!
[Leetcode] 0020. Valid Parentheses
Given a string s containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[‘ and ‘]’, determine if the input string is valid.
An input string is valid if:
Open brackets must be closed by the same type of brackets.
Open brackets must be closed in the correct order.
Every close bracket has a corresponding open bracket of the same type.
[Leetcode] 0049. Group Anagrams
Given an array of strings strs, group the anagrams together. You can return the answer in any order.
An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.