实践题目名称: 找第k小的数 问题描述: 设计一个平均时间为O(n)的算法,在n(1<=n<=1000)个无序的整数中找出第k小的数。 提示:函数int partition(int a[],int left,int right)的功能是根据a[left]~a[right]中的某个元素x(如a[lef ...
分类:
其他好文 时间:
2020-11-11 16:26:03
阅读次数:
8
1. 导致性能下降的原因 数据过多 → 分库分表 索引(单值、复合)失效 → 索引建立 关联查询太多 Join // 设计缺陷、不得已的需求 → SQL 优化 服务器调优及各个参数设置(缓冲、线程数等)→ 调整 my.cnf 2. RE: Join 查询 3. 索引简介 3.1 是什么? 【官方定义 ...
分类:
其他好文 时间:
2020-11-10 10:52:16
阅读次数:
3
题目 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NU ...
分类:
其他好文 时间:
2020-11-10 10:47:27
阅读次数:
5
标题样式1 <p> <span style=" text-align: center; padding-bottom: 6px; padding-left: 20px; padding-right: 500px; color: #800080; padding-top: 6px; box-shado ...
分类:
Web程序 时间:
2020-11-08 17:16:18
阅读次数:
37
调用本地css文件的方法 setting.py里面的内容 import os # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirn ...
分类:
其他好文 时间:
2020-11-08 16:56:15
阅读次数:
21
经典教程|基于SparkGraphX实现微博二度关系推荐导读:图计算是近几年大数据领域非常受关注的热点,社交网络中的好友关系推荐是一种典型图计算场景,本文是微博关系项目团队在二度关系计算中的一些实践,供高可用架构读者参考,作者为王舜、蒋生武、田瑞林。关系计算问题描述二度关系是指用户与用户通过关注者为桥梁发现到的关注者之间的关系。目前微博通过二度关系实现了潜在用户的推荐。用户的一度关系包含了关注、好
分类:
其他好文 时间:
2020-11-07 17:07:30
阅读次数:
27
Leetcode 101 数据结构定义: /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x ...
分类:
其他好文 时间:
2020-11-07 16:16:53
阅读次数:
21
1.关于主表和从表怎么选择的问题 select * from table, from后边的是主表,join 后边的是从表 常见的是取的字段多的表是主表,但不是常见的不一定每次都是对的。 还要看后边where 是用那张表的字段去做过滤, select a.id as menuId, a.name, a ...
分类:
数据库 时间:
2020-11-06 01:55:56
阅读次数:
23
#include <iostream> #include <vector> #include <stack> #include <queue> template <class T> typedef struct node { node* left; node* right; T val; std:: ...
分类:
其他好文 时间:
2020-11-06 01:25:12
阅读次数:
16
题解:递归求左右子树的最大深度。 /** * Definition for a binary tree node. * public class TreeNode { * int val; * TreeNode left; * TreeNode right; * TreeNode(int x) { ...
分类:
其他好文 时间:
2020-11-06 01:10:43
阅读次数:
21