摘要: 直接上代码,分析注释里import java.util.Arrays;public class Test{ public static void main(String[] agrs){ //int[] a =... 阅读全文
posted @ 2018-03-25 11:12 VictorChang 阅读(99) 评论(0) 推荐(0) 编辑
摘要: public class Search { /**1.顺序查找 时间复杂度为:O(n) */ public static int SequenceSearch(int[] a, int x) { for(i... 阅读全文
posted @ 2018-03-24 14:32 VictorChang 阅读(111) 评论(0) 推荐(0) 编辑
摘要: /** 插入排序:直接,希尔 选择排序:选择排序,堆排序 交换排序:冒泡,快速 归并排序:归并*/public class Sort{ public static void main(String[] agrs... 阅读全文
posted @ 2018-03-21 15:34 VictorChang 阅读(142) 评论(0) 推荐(0) 编辑
摘要: #include#include#include#include"Stack.h"typedef int DataType;void SortPrint(DataType*a,size_t n){ size_t ... 阅读全文
posted @ 2018-03-15 20:44 VictorChang 阅读(100) 评论(0) 推荐(0) 编辑
摘要: #include"Stack.h"#define N 6 int maze[N][N] = { {0,0,0,0,0,0}, {0,0,1,1,1,0}, {0,0,1,0,1,0}, {0,0,1,1,... 阅读全文
posted @ 2018-03-04 15:31 VictorChang 阅读(97) 评论(0) 推荐(0) 编辑
摘要: 1.给一个超过100G大小的log file, log中存着IP地址, 设计算法找到出现次数最多的IP地址?将100G的log file分成1000份相同的Ip必定会在同一个小文件里在每个文件里找出出现次数最多的... 阅读全文
posted @ 2018-03-02 16:27 VictorChang 阅读(212) 评论(0) 推荐(0) 编辑
摘要: 在实现BloomFilter,首先实现一个位图;BitMap在位图中,每个元素为“0”或“1”,表示其对应的元素不存在或者存在。typedef struct BitMap { size_t* _bits; s... 阅读全文
posted @ 2018-03-02 14:46 VictorChang 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 1.给定100亿个整数,设计算法找到只出现一次的整数 2.给两个文件,分别有100亿个整数,我们只有1G内存,如何找到两个文件交集 3.1个文件有100亿个int,1G内存,设计算法找到出现次数不超过2次的所有整... 阅读全文
posted @ 2018-03-01 17:20 VictorChang 阅读(82) 评论(0) 推荐(0) 编辑
摘要: typedef int KeyType; typedef int ValueType; typedef struct HashNode { KeyType _key; ValueType _value; s... 阅读全文
posted @ 2018-02-28 21:08 VictorChang 阅读(126) 评论(0) 推荐(0) 编辑
摘要: typedef int KeyType; typedef int ValueType; //用枚举来表示当前节点的状态typedef enum Status { EMPTY, //空 EXITS, //存在 D... 阅读全文
posted @ 2018-02-28 17:45 VictorChang 阅读(169) 评论(0) 推荐(0) 编辑