- 博客(57)
- 收藏
- 关注
原创 路由器的各种操作命令 GNS3
思科发现协议CDP 用于排错R1#show cdp neighbors detailR1(config)#cdp holdtime 60R1(config)#cdp timer 20测试网络畅通R1#pingR1#traceroute 跟踪数据包debug命令R1#debug ip packet detailR1#undebug all...
2019-04-09 21:38:52 4361 2
原创 路由器的各种配置 GNS3
配置路由器允许telentR1(config)#line vty 0 871R1(config-line)#password 123456(密码)R1(config-line)#loginR1(config-line)#exitR1(config)#endR1#config tR1(config)#enable password 234567R1(config-li...
2019-04-09 17:32:37 1958
原创 网络设备配置的基本操作命令 GNS3
1,配置vpcs的ip地址和网关PC-1>ip 地址 子网掩码 网关PC-1>ip 地址/前缀长度 网关PC-1>ip dns 地址PC-1>savePC-1>show ip2,配置路由器特权模式:R1#sh 按tab键补全R1#show versionR1#show interfaceR1#show running-...
2019-04-09 13:53:19 8123
原创 剑指offer63
#include<iostream>#include<map>using namespace std;int f(int *p,int n) { if (p == NULL || n <= 0) return INT_MIN; int min = p[0]; int v = INT_MIN; for (int i = 1; i < n; i++)...
2018-05-27 19:58:23 157
原创 剑指offer61
#include<iostream>#include<map>using namespace std;bool f(int *p) { map<int, int> m; int i = 0; while (i<5){ if (m.find(p[i]) != m.end() && p[i] != 0) return fals...
2018-05-27 19:37:39 128
原创 剑指offer58题目二
#include<iostream>#include<algorithm>using namespace std;char* Change(char *c,int num,int n) { int i = 0, j = num - 1; while (i < j) swap(c[i++],c[j--]); i = num - n; j = num - 1...
2018-05-16 22:45:07 120
原创 剑指offer58题目一
#include<iostream>#include<algorithm>using namespace std;char* Overturn(char *c,int n) { int i = 0, j = n - 1; while (i<j) swap(c[i++],c[j--]); int p = 0,q = 0; while (c[q]!='\0...
2018-05-16 22:29:40 122
原创 剑指offer57题目二
#include<iostream>#include<algorithm>using namespace std;void Print(int b,int t) { if (b % 2) { int i = b / 2; while (i >= 1) { cout << t - i<<" "; i--; } ...
2018-05-16 12:40:40 152
原创 剑指offer57题目一
#include<iostream>#include<algorithm>using namespace std;void Find(int data[],int n,int s,int* num1,int* num2) { int i = 0,j=n-1; while (i<j) { if (data[i] + data[j] > s) j...
2018-05-16 11:50:45 141
原创 剑指offer56题目二
#include<iostream>#include<algorithm>using namespace std;int Find(int data[],int n) { if (data == NULL||n<=0) exit(0); int a[32]={0}; for (int i = 0; i < n; i++){ int x = da...
2018-05-16 11:24:41 112
原创 剑指offer56题目一
#include<iostream>#include<algorithm>using namespace std;void Find(int data[],int n,int* num1,int* num2) { int x=0; for (int i = 0; i < n;i++) { x ^= data[i] ; } int t = 1; w...
2018-05-16 10:41:37 108
原创 剑指offer55题目二
#include<iostream>#include<algorithm>using namespace std;struct TreeNode { TreeNode* l; TreeNode* r; int value;};int b = 1;int depth(TreeNode *t) { if (!t) { return 0; } if...
2018-05-15 13:04:58 109
原创 剑指offer55题目一
#include<iostream>#include<algorithm>using namespace std;struct TreeNode { TreeNode* l; TreeNode* r; int value;};int depth(TreeNode *t,int h) { if (t == NULL) return h; else re...
2018-05-15 12:41:23 135
原创 剑指offer53题目三
#include<iostream>using namespace std;class Solution {public: int Find(int* p,int b, int e) { int i = b, j = e, mid=(e-b)/2+b; if (p[mid] == mid) { return mid; } else if(i<=j)...
2018-05-14 23:29:22 101
原创 剑指offer53题目二
#include<iostream>using namespace std;class Solution {public: int Find(int* p,int n) { int i = 0, j = n - 2,mid; while (i<=j){ mid = (j - i) / 2 + i; if (p[mid] > mid) { ...
2018-05-14 23:16:11 111
原创 剑指offer53题目一
class Solution {public: int Begin(int *num,int n,int k) { int i = 0, j = n - 1,mid; while (i<=j){ mid = (j - i)/2 + i; if (num[mid] == k) { if (mid > 0 && num[mid - 1] ==...
2018-05-14 22:47:33 132
原创 剑指offer52
#include<iostream>using namespace std;struct ListNode { ListNode(int x = 0) { value = x; } ListNode* next; int value;};ListNode* FristCommonNode(ListNode* a,ListNode* b) { ListNode* aa...
2018-04-29 17:47:05 142
原创 剑指offer50
#include<iostream>#include<string>#include<map>using namespace std;char OneNum(char *s) { map<char, int> m; int i = 0; while(s[i] != '\0') { m[s[i]]++; i++; } i =...
2018-04-29 17:07:24 133
原创 剑指offer48
#include<iostream>#include<string>using namespace std;void longestString(const char* s) { if (s == NULL) return; int i = 0, j = 1, position[26],maxi=i,maxj=i; for (int k = 0; k <...
2018-04-29 13:00:28 265
原创 剑指offer47
#include<iostream>#include<string>using namespace std;int MaxValue(int *v,int m,int n) { if (v == NULL || m <= 0 || n <= 0) return 0; int**max = new int*[m]; for (int i = 0; i...
2018-04-29 11:47:34 196
原创 剑指offer46
int num=0;void Translation(string s, int n) { if (n == s.length()) { num++; } else if(n<s.length()){ Translation(s, n + 1); if (n<s.length() - 1 && (((s[n] - '0')*10 + s[n + 1]...
2018-04-29 10:44:15 258
原创 剑指offer42
#include<iostream>using namespace std;int FindMaxSum(int *num,int len) { if (num == NULL||len<=0) return -1; int max = 0, i = 1,sum = num[0]; while (i<len){ if (sum < num[i]&...
2018-04-27 22:01:57 175
原创 剑指offer41
#include<iostream>#include<set>#include<vector>#include<iomanip>#include <functional>//greater,less的模板using namespace std;void MinK(const vector<int> v,int ...
2018-04-27 21:02:55 131
原创 剑指offer39
#include<iostream>using namespace std;int MoreHalfNum(int *num,int len){ int x=num[0],count=1; for (int i = 1; i < len; i++) { if (num[i] == x) count--; if (count == 0) { x = num[...
2018-04-27 19:49:24 89
原创 剑指offer38
#include<iostream>using namespace std;void Permutation(char* s,char* p) { if (*p=='\0') cout << s << endl; for (char* begin = p; *begin != '\0'; begin++){ swap(*begin,*p); P...
2018-04-27 16:52:10 172
原创 剑指offer35
#include<iostream>using namespace std;struct ListNode{ int value; ListNode* next; ListNode* sp;};ListNode* Copy(ListNode* t) { ListNode *k=NULL; ListNode* p = t; while (p != NULL) {...
2018-04-26 18:54:16 140
原创 剑指offer34
struct TreeNode { TreeNode* left; TreeNode* Right; double value;};void path(TreeNode *t,int sum,int n,vector<TreeNode *> &v) { if (n == sum&&t->left==NULL&&t->Ri...
2018-04-25 15:05:38 143
原创 剑指offer33
#include<iostream>using namespace std;struct TreeNode { TreeNode* left; TreeNode* Right; double value;};int check(char *v,int len) { if (v == NULL||len<=0) return 0; int i; if (le...
2018-04-25 14:09:34 154
原创 剑指offer32
#include<iostream>#include<queue>using namespace std;struct TreeNode { TreeNode* left; TreeNode* Right; double value;};void Print(TreeNode *t) { if (t == NULL) return; queue<...
2018-04-23 22:14:08 130
原创 剑指offer31
#include<iostream>#include<stack>using namespace std;int check(const int* a,const int* b,int len){ stack<int> v; int i = 0,j = len-1; while (i<len) { if (b[i] == a[j]){ ...
2018-04-23 20:58:35 148
原创 剑指offer30
#include<iostream>#include<stack>using namespace std;class Solution {public: stack<int>a, b; int min() { if(!b.empty()) return b.top(); else return -1; } int pop() { i...
2018-04-23 20:07:01 185
原创 剑指offer29
#include<iostream>using namespace std;void Print(int (*numbers)[4],int cols,int rows) { int t = cols > rows ? (rows+1) / 2 : (cols+1) / 2; int num = 0; while (num<t) { for (int i =...
2018-04-23 19:17:26 133
原创 剑指offer28
#include<iostream>using namespace std;struct TreeNode { TreeNode* left; TreeNode* Right; double value;};bool checkin(TreeNode* a, TreeNode* b) { if (a == b&&b == NULL) return t...
2018-04-22 16:13:17 86
原创 剑指offer27
#include<iostream>using namespace std;struct TreeNode { TreeNode* left; TreeNode* Right; double value;};void Exchange(TreeNode *t) { if (t!=NULL) { swap(t->left,t->Right); E...
2018-04-21 11:31:56 190
原创 剑指offer26
#include<iostream>using namespace std;struct TreeNode { TreeNode* left; TreeNode* Right; double value;};bool Equal(TreeNode *a, TreeNode *b) { if (a == NULL || b == NULL) return false;...
2018-04-21 11:08:29 112
原创 剑指offer25
#include<iostream>using namespace std;struct ListNode { int value; ListNode* next;};ListNode* Merge(ListNode* head1,ListNode* head2){ if (!head1 || !head2) return head1 == NULL ? head2 ...
2018-04-18 23:04:36 139
原创 剑指offer24
#include<iostream>using namespace std;struct ListNode { int value; ListNode* next;};ListNode* ReverseList(ListNode* head){ if (!head) return NULL; ListNode*p=head, *q=NULL,*h=head->...
2018-04-18 20:05:05 143
原创 剑指offer23
#include<iostream>using namespace std;struct ListNode { int value; ListNode* next;};ListNode* Find(ListNode* head){ ListNode*fast=head->next, *slow=head; while (fast!=slow){ fast ...
2018-04-18 18:56:32 131
原创 剑指offer22
#include<iostream>using namespace std;struct ListNode { int value; ListNode* next;};ListNode* Find(ListNode* head,int n){ ListNode *p=head, *q=head; int num = 0; if (head == NULL||n==...
2018-04-18 15:05:21 117
原创 剑指offer21
#include<iostream>using namespace std;bool check(int x) { return (x & 1) == 0;}//判断是否为偶数void moveNum(int *v,int len,bool(*f)(int)) { if (v == NULL || len == 0) return; int *p = v, *...
2018-04-17 11:43:54 169
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人