智乐兔

技术分享

  • Docker安装RStudio

    Docker安装RStudio

    在我前一篇文章中已讲述了,本文则讲述如何在docker中安装rstudio! 1.Docker的使用 1.1查看指定machine的IP 打开Docker Quickstart Terminal,查看docker名为default的machine的IP: docker-machine ip default 1.2连接到machine ssh连接到default machine中: docker-machine ssh default 1.3容器和镜像操作 加载名为hello-world的容器: docker run hello-world   查看已有的所有容器 ...

    查看全文

  • Hadoop学习教程(三) ---- Hadoop安装

    Hadoop学习教程(三) —- Hadoop安装

      这节就开始讲述的安装吧。在这之前先配置下SSH免密码登录,为什么需要配置这个呢?大家都知道Hadoop集群中可能有几十台机器甚至是上千台机器,而每次启动Hadoop都需要输入密码才能够登录到每台机器的DataNode上的,所以为了避免后期繁琐的操作,一般都会配置SSH免密码登录。  注:笔者使用的远程连接工具是XShell,很好用的一款远程连接工具,推荐大家使用,还可以安装一下xftp文件传输工具,方便于将自己电脑上的软件拷贝到虚拟机中,xftp和Xshell是可以配套使用的。 配置SSH免密码登录,首先需要有SSH的支持,当然,在第一篇中的安装系统中是会自己安装上SSH的,为了节省时间 ...

    查看全文

  • 克鲁斯卡尔最小生成树 Java 代码

    克鲁斯卡尔最小生成树 Java 代码

    克鲁斯卡尔最小生成树 Java 代码 import java.io.*;import java.util.*;public class Kruskal {  private final int MAX_NODES = 21;  private HashSet nodes[];               // Array of connected components  private TreeSet allEdges ...

    查看全文

  • 克鲁斯卡尔最小生成树 C 代码

    克鲁斯卡尔最小生成树 C 代码

    克鲁斯卡尔最小生成树 C 代码 #include<stdio.h>#include<stdlib.h>void printArray(int a[][100],int n);void AdjacencyMatrix(int a[][100], int n){    int i,j;    for(i = 0;i < n; i++)    {        for(j = 0;j < i; j+ ...

    查看全文

  • Floyd-Warshall最短路径 C++ 代码

    Floyd-Warshall最短路径 C++ 代码

    Floyd-Warshall最短路径 C++ 代码 #include<iostream.h>#include<conio.h>#include<stdio.h>#include<stdlib.h>class path{    int n;        int p[10][10];        int a[10][10];     ...

    查看全文

  • Floyd-Warshall最短路径 C 代码

    Floyd-Warshall最短路径 C 代码

    Floyd-Warshall最短路径 C 代码 // Floyd-Warshall algorithm// //  solves the all-pairs shortest path problem using Floyd-Warshall algorithm//  inputs:  nn, number of nodes//           connectivity matrix cmat, where 0 means disconnected//& ...

    查看全文

  • 拓扑排序(深度优先) C++ 代码

    拓扑排序(深度优先) C++ 代码

    拓扑排序(深度优先) C++ 代码 vector<int>g[N];//邻接表存储int vis[N],topo[N],cnt;bool dfs(int u){    vis[u] = -1;//-1用来表示顶点u正在访问    for(int i = 0 ; i < g[u].size() ; i ++)    {        if(vis[g[u][i]] == -1)//表示这个点进入了两次,肯定出现了 ...

    查看全文

  • 拓扑排序(深度优先) C 代码

    拓扑排序(深度优先) C 代码

    拓扑排序(深度优先) C 代码 #include<stdio.h>const long maxv=108;long v,e,count,a[maxv],used[maxv];bool g[maxv][maxv],ans;void init(){    scanf("%ld%ld",&v,&e);    for(long i=1;i<=v;i++)      for(long j=1;j<=v;j++)   & ...

    查看全文

  • 拓扑排序 C++ 代码

    拓扑排序 C++ 代码

    拓扑排序 C++ 代码 /**Program:TopologicalSort*Author:Yee-fan Zhu*/#include <fstream>using namespace std;ifstream fin("topo.in");ofstream fout("topo.out");bool TopologicalSort(int a[][101],int *ans) //可以完成拓扑排序则返回True   {        int n = a[0][0], i, j;  & ...

    查看全文

  • 拓扑排序 C 代码

    拓扑排序 C 代码

    拓扑排序 C 代码 /*  topsort.c    Topologically sort a directed acyclic graph (DAG)    by: Steven Skiena    begun: March 26, 2002*//*Copyright 2003 by Steven S. Skiena; all rights reserved. Permission is granted for use in non-commerical applicationspro ...

    查看全文

  • 连通图 C 代码

    连通图 C 代码

    连通图 C 代码 /*  connected.c    Compute the connected components of a graph.    by: Steven Skiena    begun: March 6, 2002*//*Copyright 2003 by Steven S. Skiena; all rights reserved. Permission is granted for use in non-commerical applicationsprovided ...

    查看全文

  • 深度优先搜索 C 代码

    深度优先搜索 C 代码

    深度优先搜索 C 代码 /*  bfs-dfs.c    A generic implementation of graph traversal: breadth-first    and depth-first search    begun: March 27, 2002    by: Steven Skiena*//*Copyright 2003 by Steven S. Skiena; all rights reserved. Permission ...

    查看全文