An Introduction to Sliding Window Algorithms

tags: Sliding Window source: Moore, Jordan. “An Introduction to Sliding Window Algorithms.” Medium, July 26, 2020. https://levelup.gitconnected.com/an-introduction-to-sliding-window-algorithms-5533c4fe1cc7. Efficientive algorithm: Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. – Antoine de Saint-Exupéry The following return values can use a sliding window: Minimum value Maximum value Longest value Shortest value K-sized value And contiguous is one of the biggest clues. Common data structures are strings, arrays and even linked lists. ...

March 11, 2022 · 1 min · Gray King

Window Sliding Technique

tags: Sliding Window,Brute Force Approach source: GeeksforGeeks. “Window Sliding Technique,” April 16, 2017. https://www.geeksforgeeks.org/window-sliding-technique/. Use a Sliding Window to instead Brute Force Approach, improve time complexity big O from \(O(n^2)\) to \(O(n)\).

March 11, 2022 · 1 min · Gray King

Brute Force Approach

tags: Algorithm

March 11, 2022 · 1 min · Gray King

Two Pointers

tags: Algorithm

March 11, 2022 · 1 min · Gray King

Differences between Sliding Window and Two Pointers

tags: Sliding Window,Two Pointers source: 力扣 LeetCode. “题解:借这个问题科普一下「滑动窗口」和「双指针」的区别 - 力扣(LeetCode).” Accessed March 11, 2022. https://leetcode-cn.com/problems/get-equal-substrings-within-budget/solution/jie-zhe-ge-wen-ti-ke-pu-yi-xia-hua-dong-6128z/. https://stackoverflow.com/a/64078338 Two Pointer to slove the problem of two elements that two pointes pointed. Sliding Window to slove the problem of all elements that in the window.

March 11, 2022 · 1 min · Gray King