asp子窗口读取父窗口数据_算法与数据结构基础 - 数组(Array)
數組基礎
數組是最基礎的數據結構,特點是O(1)時間讀取任意下標元素,經常應用于排序(Sort)、雙指針(Two Pointers)、二分查找(Binary Search)、動態規劃(DP)等算法。順序訪問數組、按下標取值是對數組的常見操作。
相關LeetCode題:
905. Sort Array By Parity 題解
922. Sort Array By Parity II 題解
977. Squares of a Sorted Array 題解
1150. Check If a Number Is Majority Element in a Sorted Array 題解
896. Monotonic Array 題解
448. Find All Numbers Disappeared in an Array 題解
26. Remove Duplicates from Sorted Array 題解
88. Merge Sorted Array 題解
189. Rotate Array 題解
941. Valid Mountain Array 題解
31. Next Permutation 題解
滑動窗口
一前一后指針遍歷數組,這種方法叫做滑動窗口(Sliding Window),也是遍歷數組的常用方式。更多關于滑動窗口詳見:
算法與數據結構基礎 - 滑動窗口(Sliding Window)
相關LeetCode題:
1040. Moving Stones Until Consecutive II 題解
1151. Minimum Swaps to Group All 1's Together 題解
Matrix
二維數組即矩陣(Matrix),也是常見的數據結構,可以用于表示圖。
相關LeetCode題:
867. Transpose Matrix 題解
566. Reshape the Matrix 題解
118. Pascal's Triangle 題解
695. Max Area of Island 題解
835. Image Overlap 題解
48. Rotate Image 題解
54. Spiral Matrix 題解
59. Spiral Matrix II 題解
85. Maximal Rectangle 題解
Prefix sum
Prefix sum是數組、矩陣應用的一個技巧,其有助于降低求解一些子數組問題的時間復雜度。
相關LeetCode題:
548. Split Array with Equal Sum 題解
1031. Maximum Sum of Two Non-Overlapping Subarrays 題解
209. Minimum Size Subarray Sum 題解
1074. Number of Submatrices That Sum to Target 題解
HashTable
數組與HashTable結合使用可以產生一些“火花”、降低一些問題求解的時間復雜度。例如用HashTable為數組元素計數,或用HashTable為數組元素建立反向索引。更多關于HashTable詳見:
算法與數據結構基礎 - 哈希表(Hash Table)
相關LeetCode題:
380. Insert Delete GetRandom O(1) 題解
560. Subarray Sum Equals K 題解
954. Array of Doubled Pairs 題解
總結
以上是生活随笔為你收集整理的asp子窗口读取父窗口数据_算法与数据结构基础 - 数组(Array)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 64位java_一文详解 Java 的八
- 下一篇: 5g应用场景_5G新媒体场景应用解决方案