自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 收藏
  • 关注

转载 Redis超详细教程

转载自:https://blog.csdn.net/liqingtx/article/details/60330555 看到了一篇关于Redis详细的好文 【本教程目录】 1.redis是什么 2.redis的作者何许人也 3.谁在使用redis 4.学会安装redis 5.学会启动redis 6.使用redis客户端 7.redis数据结构 – 简介 8.redis数据结构 – strings ...

2019-03-21 17:25:54 179

原创 加一 LeetCode Golang/C++ 实现方法

GO: func plusOne(digits []int) []int { lens := len(digits) for i:= lens-1;i>=0;i–{ if digits[i]==9{ digits[i]=0 }else{ digits[i]=digits[i]+1 return digits } } if digits[0]==0{ digits[0]=1 digits = ...

2019-03-12 20:49:13 224

原创 Leetcode 两个数组的交集 golang GO语言和C++ 的实现方法

思路是定义一个map,一个数组result 把参数里的第一个数组的值倒入map中,然后遍历参数的第二个数组,如果map里存在第二个数组的值, map 的value减一,然后倒入result里 返回result C++ 实现方法 vector intersect(vector& nums1, vector& nums2) { vector result; map<int,int...

2019-03-12 17:56:09 774

原创 Robot framework里 Run key word If 新手应学会的知识

今天写case时想进行对一个变量判断如果true 就运行代码 但是用Run key word If 无法使用,, 后来发现 可以把你想运行的代码封装成一个keyword 然后调用即可 ...

2019-02-28 21:42:07 1142

原创 (leetcode)C++实现移动0

void moveZeroes(vector& nums){ if(nums==NULL) return ; int n = nums.size(); int temp =0; for(int i =0 ;i <n ; i++) { if(nums[i]!=0) { nums[temp]=nums[i]; temp++; } } while(temp<n) { nums[tem...

2019-02-26 12:32:18 314

原创 (leetcode)C++实现两个数组的交集||

vector <int> intersect(vector<int>&nums1, vector<int>& nums2) { vector<int> result; map<int, int>temp; for(int i =0; i<nums1.size(); i++) { ...

2019-02-26 12:24:04 529

原创 (leetcode)C++实现旋转数组

void rotate(int * nums, int numsSize, int k) { if(nums==NULL||numsSize<=0) return ; int nk = k%numsSize; int middle = numsSize - nk; swap(nums,0,middle-1); swap(nums,middle...

2019-02-26 12:14:07 454

原创 (leetcode)C++ 手写从排序数组中删除排序项

int remoceDuplicates(int * nums, int numsSize){ int pre = 0; int cur = 0 ; if(numsSize == 0) return 0; while(cur < numsSize) { if(nums[pre] == nums[cur]) cur++; else { nums[++pre]= nums[cur++]; } }...

2019-02-26 12:07:42 172

原创 C++ 手写实现字符串转整数atoi函数 (leetcode字符串转整数 atoi)

int Myatoi( string str){ int i =0; int n = str.size(); int flag = 0; //标记正负 int ans = 0; int ans_end = 0; for(i; i<n; i++) { ...

2019-02-26 11:53:56 1191

原创 C++手写实现strstr函数(leetcode 实现strstr)

i nt strStr( string haystack, string needle){ //先抛出两个 字符串都为空和被比较字符串haystack为空的情况 if(haystack.size() == 0 && needle.size() != 0) return -1; if(haystack == " " && n...

2019-02-26 11:29:34 648

转载 浏览器输入一个URL,按下回车到页面显示发生了什么

域名解析 发起TCP的3次握手 建立TCP连接后发起http请求 服务器端响应http请求,浏览器得到html代码 浏览器解析html代码,并请求html代码中的资源 浏览器对页面进行渲染呈现给用户 原博:https://blog.csdn.net/weixin_39430694/article/details/78534103 ...

2019-02-26 11:06:35 394

原创 C++ 实现归并排序(分冶法)

//分 void merge_sort(int * data, int start , int end , int * result) { if(1==end - start) //如果区间内只有两个元素 直接对这两元素排序 { if(data[start]> data[end]) { ...

2019-02-26 11:02:08 313

原创 C++经典面试题:手写两个单链表判断是否有环,环节点

typedef struct Node { struct Node *pNext; int data; }Node; Node * FindNode(Node *pHead1,Node * pHead2) { if(pHead1==NULL||pHead2==NULL) return NULL; int nLength1=0; //标记链表一的长度 int nLength2=...

2019-02-26 09:55:32 405

原创 Robot Framework httppost 不想校验expect期望值

写case时,想获取errorNo 不想通过底层封装的post方法直接报错,发现需要把expect值设成none ,设置expect = 是不行的 必须是expect=${None} 记录一下。。。。 可能是Robot 不认为None就是空吧 ...

2019-02-25 21:57:38 267

原创 Robot framework遇到的坑 新手指南 变量无法识别

今天在写case时发现 变量不能被识别 报错信息是No Keyword with name ${result} Not Found. 后来发现原因是因为robot与python很像,对空格很敏感 把报错行缩后 就通过拉。 ...

2019-02-25 21:52:19 3288

原创 C++ 手写单链表反转(ReverseList)头插法

List * Reverse(List * pHead) { if(pHead==NULL||pHead->pNext==NULL) return pHead; //链表小于2不用反转 List *p ,r, q; //定义三个指针 p = pHead; r = pHead->pNext; pHead ->pNext = NULL; //一个指向头,一个标记头的下一...

2019-02-25 21:42:51 1120

原创 C++手写快排(QuickSort)

int Sort(int arr[], int nLow, int nHigh) { int temp = arr[nLow]; while(nLow < nHigh) { //从后往前找比标准值小的 while(nLow<nHigh) { if(arr[nHigh]<temp) { arr[nLow]=arr...

2019-02-25 17:48:23 1174

原创 C++ 递归/非递归实现斐波那契数列 Golang 闭包实现斐波那契数列

C++ 递归 int Fibonacci(int n) { if(n==1||n==2) //1和2不用计算直接返回1 return 1; return Fibonacci(n-1)+Fibonacci(n-2); } C++ 非递归 int Fibonacci2(int n) { if(n==1||n==2) return 1; int fn1 = 1; int fn2 = 1; ...

2019-02-25 17:06:05 346

原创 学习go语言里Duck typing 概念

最近学习go语言 ,了解到了duck typing 这个概念。 原意为: “如果一个物体,它长得像“”鸭子”,叫起来像鸭子” 那么我就认为它是鸭子。 觉得这个不太好理解 自己举几个例子: 鸭子 通常定义为“形体为黄色,会浮在水面叫声为嘎嘎嘎的家禽” 但是“我”(假设我是小孩子)不这么认为,我认为 大黄鸭就是鸭子,它是黄色的,可以漂浮,会嘎嘎的叫。 再比如“我”(假设我是个小公举)我认为 “玻...

2019-02-22 15:55:27 949

原创 C++ static 关键字 总结/ static全局变量和全局变量的区别

首先了解一下内存的分布图: 代码区 全局数据区 堆区 栈区 代码区:存储代码 全局数据区:static 数据, 全局变量, const常量 堆区:由程序员自己new出来的动态数据, 需要手动释放。若忘记释放,会造成内存泄漏,则程序结束时会由操作系统回收。 栈区:函数内部变量,由IDE自动分配,结束时自动释放。 后续可以再仔细研究一下堆区和栈区的区别,这里先不讨论。 首先总结static全局变量...

2019-02-22 15:08:47 4733 1

转载 [LeetCode]字符串——字符串中的第一个唯一字符 C ++

[LeetCode]字符串——字符串中的第一个唯一字符 给定一个字符串,找到它的第一个不重复的字符,并返回它的索引。如果不存在,则返回 -1。 C++ 复制代码 class Solution { public: int firstUniqChar(string s) { unordered_map<char, int> m; for (char c : s) m[c]++; //这个和...

2018-12-18 18:04:10 190

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除