- 博客(5)
- 资源 (10)
- 收藏
- 关注
原创 Binary Tree Paths
Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->2->5", "1->3"]二话不说,上代码:
2015-08-31 21:40:28 470
原创 Longest Substring Without Repeating Characters —— Leetcode
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. Fo
2015-08-08 15:01:23 426
原创 Kth Smallest Element in a BST —— Leetcode
Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Follow up:What if the
2015-08-04 11:31:35 485
原创 多线程、IO模型、epoll杂谈
1.面向多核的服务器编程时,多线程并不如多进程,因为对于每个进程来说,资源是独立的,切换core的时候无需考虑上下文;而多线程中,每个线程共享资源,在core切换的时候,资源必须从一个core复制到另一个core才能继续运算。换句话说,在cpu多核的情况下,多线程反而不如多进程。2.浏览器开一个页面,页面中很多图片,下载每个图片开一个线程;迅雷下载的时候是把文件分片
2015-08-03 20:00:09 1217
原创 Redis服务器剖析
本文主要分析redis服务器的工作的实现原理,事件,以及redis与memcache处理高并发请求的对比。1. Redis的工作流程首先从宏观上来看一下redis如何处理一个请求,以set key value为例,分为以下4步:(1) client向server发送命令请求set key valueclient会将set key value转换成协议:*
2015-08-03 19:32:50 569
Cisco IP Routing: Packet Forwarding and Intra-domain Routing Protocols
2012-05-03
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人