码迷,mamicode.com
首页 >  
搜索关键字:r语言中的 vector    ( 11651个结果
高精度算法
复习一下高精度: 高精度加法: #include <iostream> #include <vector> #include <string> #include <algorithm> using namespace std; vector<int> add(vector<int> a,vector ...
分类:编程语言   时间:2020-02-11 21:55:58    阅读次数:89
Separating Axis Theorem(SAT)
参考 http://www.dyn4j.org/2010/01/sat/ SAT: 用来判断两个Convex是否相交。同时可以找到而者minimum penetration vector。 凹多边形可以拆成多个凸多边形 如果能找到一个Axis,两个convex的投影不交叉,那么这两个convex也不 ...
分类:其他好文   时间:2020-02-11 19:16:56    阅读次数:79
Java - 集合 - List
1、List实现类:ArrayList、LinkedList、Vector ArrayList使用: 1 void test() { 2 //声明 3 List<String> testlist = new ArrayList<>(); 4 5 //添加元素 .add方法 6 testlist.ad ...
分类:编程语言   时间:2020-02-11 19:12:55    阅读次数:88
Eigen库学习---Map类
Eigen中定义了一系列的vector和matrix,相比copy数据,更一般的方式是复用数据的内存,将它们转变为Eigen类型。Map类很好地实现了这个功能。 Map定义 Map(PointerArgType dataPtr, Index rows, Index cols, const Strid ...
分类:其他好文   时间:2020-02-11 17:42:39    阅读次数:127
fhq-Treap 文艺平衡树代码记录
#include<iostream> #include<algorithm> #include<vector> #include<cstdio> #include<string> using namespace std; const int N=1e4+10; int a[N]; int root; ...
分类:其他好文   时间:2020-02-11 11:47:35    阅读次数:78
图的遍历——A1013Battle over cities(25) 求需要添加多少条边才能构成连通图转化为找连通分量(可由DFS 和 并查集来找连通分量)
#include <bits/stdc++.h> #include <stdio.h> #include <stdlib.h> #include <queue> using namespace std; const int N = 1111; vector<int> G[N];//邻接表 bool ...
分类:其他好文   时间:2020-02-11 11:40:20    阅读次数:68
bzoj4229 选择
URL https://www.lydsy.com/JudgeOnline/problem.php?id=4229 简要题意 给一个无向图。 多次询问,每次删掉一条边,或者询问两个点是否在同一个边双连通分量内。 解法 倒着做。 先只保留所有操作结束后剩下的边,建出边双连通分量对应的森林。 然后倒序加 ...
分类:其他好文   时间:2020-02-11 09:44:42    阅读次数:55
迭代遍历二叉树
二叉树的递归遍历很容易写出来,对于递归遍历则需要借助辅助栈,并且不同的遍历次序迭代的写法也不尽相同,这里整理一些二叉树迭代遍历的实现 二叉树的前序遍历 [leetcode144]:https://leetcode cn.com/problems/binary tree preorder traver ...
分类:其他好文   时间:2020-02-11 00:35:37    阅读次数:73
Java编程知识点梳理
1. elementAt() temp.elementAt(0) 返回temp这个vector里面存放的第一个元素 也是一个vector类型。 2. 字符串空格分割 3. ==与equals ==比较引用,equals比较值 4. 删除字符串最后一个汉字 5. String与string java中 ...
分类:编程语言   时间:2020-02-11 00:26:43    阅读次数:88
559.N叉树的最大深度(LeetCode)
dfs深度优先搜索 (注意:题目有思路时要注意搜索边界条件!!!) 1.要判断根结点的子节点是否为空,如果没有子节点,那么深度就是1个根结点。 2.设置一个深度最大值ans,递归搜索得到一个深度值时,若搜索到的深度大于当前ans的值,就更新ans值。 3.要注意,存储子节点时用的是vector容器, ...
分类:其他好文   时间:2020-02-10 18:22:52    阅读次数:66
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!