JavaScript-Algorithms icon indicating copy to clipboard operation
JavaScript-Algorithms copied to clipboard

基础理论+JS框架应用+实践,从0到1构建整个前端算法体系

Results 114 JavaScript-Algorithms issues
Sort by recently updated
recently updated
newest added

![](http://resource.muyiy.cn/image/20200629004211.jpg) ### 引言 今天这篇文章讲解一道活跃于各个大厂(腾讯、字节、阿里等)面试中的题目:Top K 问题,将按照以下脉络介绍: - 什么是 Top K 问题 - Top K 问题的五种经典解法 - 快速回顾与总结 - 练习题 Top K 三剑客:最小 K 个数、前 K 个高频元素、第 K 个最小元素(含解答) 下面直接开始吧👇 ###...

给定一个二叉搜索树,编写一个函数 `kthSmallest` 来查找其中第 `k` 个最小的元素。 **说明:** 你可以假设 k 总是有效的,1 ≤ k ≤ 二叉搜索树元素个数。 **示例 1:** ```js 输入: root = [3,1,4,null,2], k = 1 3 / \ 1 4 \   2...

腾讯
LeetCode

Design and develop an advanced trading analysis system for the "sisterAn/JavaScript-Algorithms" repository, enabling insights and automated trades based on various strategies and market data. **Required features:** - Implement modules for...

题目链接:https://leetcode.cn/problems/binary-tree-right-side-view/description/ 给定一个二叉树的 根节点 root,想象自己站在它的右侧,按照从顶部到底部的顺序,返回从右侧所能看到的节点值。 > 输入:root = [1,2,3,null,5,null,4] > 输出:[1,3,4] > ![image](https://github.com/user-attachments/assets/8361c0bc-b71b-4571-99b4-f554b02038a5) > 输入:root = [1,2,3,4,null,null,null,5] > 输出:[1,3,4,5] > ![image](https://github.com/user-attachments/assets/11755b12-4016-40d1-83cb-a8e8897bb31b)