Description You live in a village but work in another village. You decided to follow the straight path between your house (A) and the working place (B
分类:
其他好文 时间:
2016-03-02 21:31:47
阅读次数:
144
插入排序 1.简介 插入排序(Insertion Sort)的算法描述是一种简单直观的排序算法。它的工作原理是通过构建有序序列,对于未排序数据,在已排序序列中从后向前扫描,找到相应位置并插入。插入排序在实现上,通常采用in-place排序(即只需用到O(1)的额外空间的排序),因而在从后向前扫描过程...
分类:
编程语言 时间:
2016-03-01 00:42:47
阅读次数:
261
Given a binary tree, flatten it to a linked list in-place. For example,Given 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look like: 1 \ 2 \ 3 \ 4
分类:
其他好文 时间:
2016-02-28 13:49:16
阅读次数:
141
题目: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
分类:
其他好文 时间:
2016-02-27 15:03:03
阅读次数:
111
Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't ma
分类:
其他好文 时间:
2016-02-26 23:38:31
阅读次数:
353
Given a singly linked list L: 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
分类:
其他好文 时间:
2016-02-24 19:25:26
阅读次数:
149
Given a singly linked list L: 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
分类:
其他好文 时间:
2016-02-23 06:05:29
阅读次数:
185
Reverse a linked list from position m to n. Do it in-place and in one-pass. For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2-
分类:
其他好文 时间:
2016-02-22 17:15:12
阅读次数:
166
捕获所有异常(catch-all)的catch子句的形式为“catch(…)”。 // matches any exception that might be thrown catch(…) { // place our code here } “catch(…)”经常与重新抛出异常的“throw;
分类:
编程语言 时间:
2016-02-14 09:07:49
阅读次数:
161
//: Playground - noun: a place where people can play import Foundation /* 可选链: 1.可选链访问方式:将强制解析的感叹号换成?, 在隐式解析的后面也添加? 2.可选链会自动判断程序访问的关联实例是否为nil, 即使为nil,
分类:
其他好文 时间:
2016-02-05 18:49:27
阅读次数:
167