herrDeng網內搜尋

自訂搜尋

Ads

2025年8月5日 星期二

segment tree C++解Leetcode 3479 Fruits Into Baskets III


segment tree C++解Leetcode 3479  Fruits Into Baskets III
線段樹(segment tree)是一種進階的資料結構,可以用來解決一些 LeetCode 難題。
線段樹本質上是一棵二元樹;它可以用二元樹來實現,但更常見的是使用陣列表示。這題需要用到有最大值的線段樹;以及一種尋找第一個不小於target的basket然後更新的方法。
------
Segment tree is an advance data struture which can solve several Leetcode questions.
Segment tree is basically a binary tree, ; it can be implemented by using binary tree, but most frequently its array representation way. This question needs the segment tree with max; and a method which  searchs the 1st basket not less than target & then updates it.

沒有留言:

Related Posts Plugin for WordPress, Blogger...

熱門文章