iT邦幫忙

鐵人檔案

2024 iThome 鐵人賽
回列表
佛心分享-刷題不只是刷題

Java刷題B:Leetcode Top 100 Liked 系列

此主題將有三位參賽者共同參與,我們將合力完成三方共 90篇的鐵人文章(Java刷題A/B和C++刷題)。根據LeetCode Top 100 Liked題目集的脈絡,我們將介紹共十四種演算法,並透過Java和C++實作LeetCode上的題目。

參賽天數 13 天 | 共 13 篇文章 | 1 人訂閱 訂閱系列文 RSS系列文 團隊鼠家沒有暑假
DAY 1

Day1 演算法介紹:二元搜尋法(Binary Search)

二元搜尋法(Binary Search),又稱作二分搜尋法、對數搜尋,是一個在已排序的序列中,快速找出特定元素的搜尋演算法。此種搜尋法會先將各元素做排序,並且每...

2024-09-15 ‧ 由 ilun0221 分享
DAY 2

Day2 Binary Search 題目1:33. Search in Rotated Sorted Array

原文題目 There is an integer array nums sorted in ascending order (with distinct val...

2024-09-16 ‧ 由 ilun0221 分享
DAY 3

Day3 Binary Search 題目2:35. Search Insert Position

原文題目 Given a sorted array of distinct integers and a target value, return the in...

2024-09-17 ‧ 由 ilun0221 分享
DAY 4

Day4 Binary Search 題目3:74. Search a 2D Matrix

原文題目 You are given an m x n integer matrix matrix with the following two propert...

2024-09-18 ‧ 由 ilun0221 分享
DAY 5

Day5 演算法介紹:動態規劃(Dynamic Programming)

動態規劃(Dynamic Programming) 動態規劃是一種有效率計算由子問題堆疊而成的演算法,是一種常見的解題方式。透過將問題分解成許多可以利用簡單方法...

2024-09-19 ‧ 由 ilun0221 分享
DAY 6

Day6 Dynamic Programming 題目1 :70. Climbing Stairs

原文題目 You are climbing a staircase. It takes n steps to reach the top. Each time...

2024-09-20 ‧ 由 ilun0221 分享
DAY 7

Day7 Dynamic Programming 題目2:198. House Robber

原文題目 You are a professional robber planning to rob houses along a street. Each h...

2024-09-21 ‧ 由 ilun0221 分享
DAY 8

Day8 Dynamic Programming 題目3:139. Word Break

原文題目 Given a string s and a dictionary of strings wordDict, return true if s can...

2024-09-22 ‧ 由 ilun0221 分享
DAY 9

Day9 演算法介紹:貪婪(Greedy Algorithm)

貪婪演算法(Greedy Algorithm) 又稱作貪心法,簡單來說,此演算法是在每一個步驟使用貪心原則,只考慮當前情況的前提下選擇最優解法。其精神在於「只做...

2024-09-23 ‧ 由 ilun0221 分享
DAY 10

Day10 Greedy Algorithm題目1:121. Best Time to Buy and Sell Stock

原文題目 You are given an array prices where prices[i] is the price of a given stock...

2024-09-24 ‧ 由 ilun0221 分享