10 2014 档案

摘要:题目描述:Given a singly linked listL:L0→L1→…→Ln-1→Ln,reorder it to:L0→Ln→L1→Ln-1→L2→Ln-2→…You must do this in-place without altering the nodes' values.For... 阅读全文
posted @ 2014-10-21 15:21 skycore 阅读(140) 评论(0) 推荐(0) 编辑
摘要:题目描述:Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order re... 阅读全文
posted @ 2014-10-20 22:58 skycore 阅读(163) 评论(0) 推荐(0) 编辑
摘要:文件描述符:进程通过文件描述符来操作文件,文件描述符可以通过open, openat, creat系统调用返回;shell和其他应用默认打开标准输入(STDIN_FILENO),标准输出(STDOUT_FILENO),标准错误(STDERR_FILENO)三个文件描述符。open和openat函数:... 阅读全文
posted @ 2014-10-20 21:20 skycore 阅读(212) 评论(0) 推荐(0) 编辑
摘要:0 导读 缩写:构造函数ctor 析构函数 dtor 1 让自己习惯C++ C++次语言:C, Object_Oriented C++, Template C++, STL 以const, enum, inline替换#define const 成员函数承诺绝对不改变其对象的... 阅读全文
posted @ 2014-10-20 08:38 skycore 阅读(442) 评论(0) 推荐(0) 编辑
摘要:题目描述:Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4... 阅读全文
posted @ 2014-10-20 08:31 skycore 阅读(139) 评论(0) 推荐(0) 编辑
摘要:题目描述:Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".解题方案: 1 class Solution { 2 public: 3 s... 阅读全文
posted @ 2014-10-18 09:47 skycore 阅读(129) 评论(0) 推荐(0) 编辑
摘要:题目描述:You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a si... 阅读全文
posted @ 2014-10-17 15:09 skycore 阅读(162) 评论(0) 推荐(0) 编辑
摘要:题目描述:Say you have an array for which theithelement is the price of a given stock on dayi.If you were only permitted to complete at most one transactio... 阅读全文
posted @ 2014-10-16 22:58 skycore 阅读(134) 评论(0) 推荐(0) 编辑
摘要:题目描述:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.... 阅读全文
posted @ 2014-10-16 22:38 skycore 阅读(149) 评论(0) 推荐(0) 编辑
摘要:题目描述:Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra spac... 阅读全文
posted @ 2014-10-15 08:36 skycore 阅读(115) 评论(0) 推荐(0) 编辑
摘要:题目描述:Given a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using extra space?解题方案:使用快慢指针,如果有环,快指针肯定会追上慢指针。下面是该题的代码... 阅读全文
posted @ 2014-10-14 23:00 skycore 阅读(147) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示