码迷,mamicode.com
首页 >  
搜索关键字:algorithm    ( 11758个结果)
COMPSCI 671D Fall
COMPSCI 671D Fall 2019Homework 41 EM Algorithm for Topic Modeling (35 points)In this question we will try to design an algorithm for discovering the a ...
分类:其他好文   时间:2019-12-19 13:06:15    阅读次数:85
归并排序
#include<iostream> #include<cstring> #include<vector> #include<algorithm> #include<map> using namespace std; void merge(int A[], int left,int mid,int ...
分类:编程语言   时间:2019-12-18 21:57:11    阅读次数:76
Baozi Leetcode solution 229: Major Element II
Problem Statement Given an integer array of size n, find all elements that appear more than ? n/3 ? times. Note: The algorithm should run in linear ti ...
分类:其他好文   时间:2019-12-18 14:53:18    阅读次数:76
详解 TCP 超时与重传机制——长文预警
上一篇介绍 TCP 的文章「 "TCP 三次握手,四次挥手和一些细节" 」反馈还不错,还是蛮开心的,这次接着讲一讲关于超时和重传那一部分。 我们都知道 TCP 协议具有重传机制,也就是说,如果发送方认为发生了丢包现象,就重发这些数据包。很显然,我们需要一个方法来「 猜测 」是否发生了丢包。最简单的想 ...
分类:其他好文   时间:2019-12-18 11:06:29    阅读次数:120
剑指offer-面试题49-丑数-空间换时间
/* 题目: 求从1开始的第n个丑数。 */ /* 思路: 按顺序列出各个丑数。 */ #include<iostream> #include<cstring> #include<vector> #include<algorithm> #include<map> using namespace st ...
分类:其他好文   时间:2019-12-17 22:22:47    阅读次数:92
Four modifications for the Raft consensus algorithmRaft一致性算法的四个改进译文
最近用业余时间对Four modifications for the Raft consensus algorithm论文进行了翻译,该论文从4个方面优化了Raft实现,对工程实现的借鉴意义如下: 1、Cluster initialization:可以解决多数派节点异常的情况下,集群始终不可用问题, ...
分类:编程语言   时间:2019-12-17 22:08:01    阅读次数:89
[WC2007] 剪刀石头布
link $solution:$ 考虑如何求完全图上的三元环个数,考虑对于 $(i,j,k)$ ,若其不是三元环则必有一个的度数为 $2$ ,则总个数为 $$\dbinom{n}{3}-\sum_{i=1}^n \dbinom{d_i}{2}$$ 若要求式子最小,则 $$min\{\sum_{i=1 ...
分类:其他好文   时间:2019-12-17 20:41:28    阅读次数:75
剑指offer-面试题50-第一个只出现一次的字符-哈希表
/* 题目: 求字符串第一个只出现一次的字符。 */ /* 思路: 使用map遍历两次,第一次计数,第二次找到计数为1的第一个字符。 */ #include<iostream> #include<cstring> #include<vector> #include<algorithm> #inclu ...
分类:其他好文   时间:2019-12-17 20:38:51    阅读次数:94
C++内置二分查找用法
c++内置二分查找 #include < algorithm > 一、binary_search:查找某个元素是否出现。函数模板:binary_search(arr[], arr[]+size, indx)1参数说明:arr[]: 数组首地址size:数组元素个数indx:需要查找的值函数功能: 在 ...
分类:编程语言   时间:2019-12-17 20:14:18    阅读次数:92
最长递增子序列 dp
/* Name: Copyright: Author: 流照君 Date: data Description: */ #include <iostream> #include<string> #include <algorithm> #include <vector> #define inf 0x3 ...
分类:其他好文   时间:2019-12-17 16:36:14    阅读次数:88
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!