文章 2024-08-07 来自:开发者社区

【Leetcode刷题Python】295. 数据流的中位数

1 题目 中位数是有序列表中间的数。如果列表长度是偶数,中位数则是中间两个数的平均值。 例如, [2,3,4] 的中位数是 3 [2,3] 的中位数是 (2 + 3) / 2 = 2.5 设计一个支持以下两种操作的数据结构: void addNum(int num) - 从数据流中添加一个整数到数据结构中。double findMedia...

文章 2022-02-17 来自:开发者社区

​LeetCode刷题实战352:将数据流变为多个不相交区间

今天和大家聊的问题叫做 将数据流变为多个不相交区间,我们先来看题面:https://leetcode-cn.com/problems/top-k-frequent-elements/Given a data stream input of non-negative integers a1, a2, ..., an, summarize the numbers seen so far as a l....

文章 2022-02-17 来自:开发者社区

​LeetCode刷题实战346:数据流中的移动平均值

今天和大家聊的问题叫做 数据流中的移动平均值,我们先来看题面:https://leetcode-cn.com/problems/reverse-vowels-of-a-string/Given a stream of integers and a window size, calculate the moving average of all integers in the sliding wi....

本页面内关键词为智能算法引擎基于机器学习所生成,如有任何问题,可在页面下方点击"联系我们"与我们沟通。

算法编程

开发者社区在线编程频道官方技术圈。包含算法资源更新,周赛动态,每日一题互动。

+关注
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等