摘要:
以http://www.cnblogs.com/Zzz-y/p/9107554.html里的 server 为雏形写了一个迷你型的多人聊天室。 client跟之前一样。主要对 server 做了一些改进: 1、聊天室要实现收到消息后,对所有的client广播,所以这边改成建立一个线程服务一个客户,于 阅读全文
摘要:
Given an unsorted array of integers, find the length of longest increasing subsequence. 找数组中最长的升序序列,不需要连续。 从前往后遍历数组,然后用一个数组保存当前的升序序列。对于每一个数,都找到目前升序序列中 阅读全文
摘要:
Given a binary tree rooted at root, the depth of each node is the shortest distance to the root. A node is deepest if it has the largest depth possibl 阅读全文
摘要:
用C++操作MySQL数据库,linux下需要用到头文件 #include <mysql/mysql.h> 说明:https://blog.csdn.net/Linux_ever/article/details/50651513 为了使用方便,写了一个MyDataBase类,提供一些基本的数据库操作 阅读全文
摘要:
Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be integ 阅读全文
摘要:
We have a two dimensional matrix A where each value is 0 or 1. A move consists of choosing any row or column, and toggling each value in that row or c 阅读全文
摘要:
Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maxim 阅读全文
摘要:
Given a balanced parentheses string S, compute the score of the string based on the following rule: () has score 1 AB has score A + B, where A and B a 阅读全文
摘要:
Validate if a given string is numeric. Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => true 判断字符串是否代表了有效数字。 这道题有点坑,情况比较多 阅读全文
摘要:
Given two strings S and T, return if they are equal when both are typed into empty text editors. # means a backspace character. Can you solve it in O( 阅读全文