Machine Learning, AI and Programming

Tag: Red Black Tree

Leetcode : Sliding Window Median

Problem Statement Solution: The brute force approach to solve this problem is to sort the numbers in each window and then compute the median for each window. Since there are K numbers in each window, thus the run-time complexity of the brute force approach is O(N*K*logK) because, there are N-K windows and sorting each window is O(K*logK).

Continue Reading →