上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页
摘要: Given an array and a value, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, you 阅读全文
posted @ 2017-11-27 09:42 爱简单的Paul 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 转载 单机最大tcp连接数 网络编程 在tcp应用中,server事先在某个固定端口监听,client主动发起连接,经过三路握手后建立tcp连接。那么对单机,其最大并发tcp连接数是多少? 如何标识一个TCP连接 在确定最大连接数之前,先来看看系统如何标识一个tcp连接。系统用一个4四元组来唯一标识 阅读全文
posted @ 2017-11-20 13:18 爱简单的Paul 阅读(7241) 评论(0) 推荐(1) 编辑
摘要: 1. tcp 连接的最大数量,tcp 用什么来标识 2. 多线程时如何避免互斥 3. protected 关键字 4. 动态库和静态库 5. 线程池 6.多继承时的虚表 网络编程需要加强 阅读全文
posted @ 2017-11-20 12:46 爱简单的Paul 阅读(631) 评论(0) 推荐(0) 编辑
摘要: 1.懒汉模式。 2. 饿汉式: 饿汉式是线程安全的。 阅读全文
posted @ 2017-11-18 17:47 爱简单的Paul 阅读(588) 评论(0) 推荐(0) 编辑
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 递归实现: /* 阅读全文
posted @ 2017-11-17 23:40 爱简单的Paul 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Invert a binary tree. to Trivia:This problem was inspired by this original tweet by Max Howell: 阅读全文
posted @ 2017-11-17 23:26 爱简单的Paul 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to h 阅读全文
posted @ 2017-11-15 14:17 爱简单的Paul 阅读(184) 评论(2) 推荐(0) 编辑
摘要: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note:You may assume that nums1 has enough space (size tha 阅读全文
posted @ 2017-11-14 13:08 爱简单的Paul 阅读(112) 评论(2) 推荐(0) 编辑
摘要: You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair (c, d) can follow an 阅读全文
posted @ 2017-11-13 12:01 爱简单的Paul 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 挖坑待更 阅读全文
posted @ 2017-11-11 17:34 爱简单的Paul 阅读(152) 评论(1) 推荐(0) 编辑
摘要: 挖坑待更。。。。 阅读全文
posted @ 2017-11-11 17:33 爱简单的Paul 阅读(165) 评论(1) 推荐(0) 编辑
摘要: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文
posted @ 2017-11-11 17:32 爱简单的Paul 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1、左值和右值的概念 左值是可以放在赋值号左边可以被赋值的值;左值必须要在内存中有实体; 右值当在赋值号右边取出值赋给其他变量的值;右值可以在内存也可以在CPU寄存器。 一个对象被用作右值时,使用的是它的内容(值),被当作左值时,使用的是它的地址。 2、引用 引用是C++语法做的优化,引用的本质还是 阅读全文
posted @ 2017-11-05 17:43 爱简单的Paul 阅读(1248) 评论(0) 推荐(1) 编辑
摘要: Given a sorted array, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate extra space fo 阅读全文
posted @ 2017-11-04 23:15 爱简单的Paul 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 结果: 21 21 21 21 阅读全文
posted @ 2017-11-04 16:22 爱简单的Paul 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 不同继承方式的影响主要体现在: 1、派生类成员对基类成员的访问控制。 2、派生类对象对基类成员的访问控制。 三种继承方式: 1、公有继承(public) ① 基类的public和protected成员的访问属性在派生类中保持不变,但基类的private成员不可访问。 ② 派生类中的成员函数可以直接访 阅读全文
posted @ 2017-11-03 23:04 爱简单的Paul 阅读(2606) 评论(0) 推荐(0) 编辑
摘要: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文
posted @ 2017-10-31 16:39 爱简单的Paul 阅读(151) 评论(0) 推荐(0) 编辑
摘要: void reverse(char *str){ char* end = str; char tmp; if (str){ while (*end != '\0'){ // 找出字符串的末尾 ++end; } } end--; // 回退一个字符 // 从字符串... 阅读全文
posted @ 2017-10-30 22:51 爱简单的Paul 阅读(322) 评论(0) 推荐(0) 编辑
摘要: // 思路:左右两个指针,左右两个和,当左边和大的时候右边指针左移一位,和增加一个数 int findIndex (vector nums){ if (nums == NULL) return -1; if (nums.size() == 1) return 0; int left = nums[0], l = 0, right = nums[nums.size()... 阅读全文
posted @ 2017-10-30 22:41 爱简单的Paul 阅读(324) 评论(2) 推荐(0) 编辑
摘要: 1. 一棵二叉树,遍历第三层的结点:在递归过程中加入一个结点高度的参数,一旦高度等于3便输出 2. 给一个十进制数,输出转化为二进制后的最后8位。 3. 自己写一个Stack类,要实现push、pop操作 4. 在数组中取一个位置,让这个位置之前的树的和与之后的和的差绝对值最小 5. 二分查找 ,动 阅读全文
posted @ 2017-10-30 22:29 爱简单的Paul 阅读(283) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 ··· 13 下一页