Implement an efficient sliding window algorithm to detect anomalies in continuous sensor data streams.