题目:将给定的路径名简化,返回最简形式。
path = "/home/",
=> "/home"
path = "/a/./b/../../c/",
=> "/c"
虽然咋看起来比较杂乱,但还是比较整齐的,每个部分由‘/‘进行分割,就像文本处理中,由空格或tab分割的单词一样,对得到的不同的分割此进行不同的处理。得到的可能的分割词包括:
string simplifyP...
分类:
其他好文 时间:
2014-05-26 06:13:24
阅读次数:
213
Paraview几乎把VTk发挥到了极致,所以如果想能够对Paraview能够熟练的应用,必须熟悉VTK的一些基础的知识,现在整理一下VTK的一些理论知识!
1. VTK调研
1.1 VTK的程序构架
VTK在基础的图形函数库OpenGL的基础上采用面向对象的设计方法发展起来的,将一些常用的算法封装起来以供用户调用。
VTK采用流水线(p ipe line)机制,由可视化模...
分类:
其他好文 时间:
2014-05-25 01:41:35
阅读次数:
324
【题目】
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.
For example,
Given the following matrix:
[
[ 1, 2, 3 ],
[ 4, 5, 6 ],
[ 7, 8, 9 ]
]
You should return [1,2,3,6,9,8,7,4,5].
【题意】
螺旋输出MxN...
分类:
其他好文 时间:
2014-05-24 23:11:02
阅读次数:
279
【题目】
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.
For example, given the array [?2,1,?3,4,?1,2,1,?5,4],
the contiguous subarray [4,?1,2,1] has the largest sum = 6.
【题意】
给定一个数组,找出和最大的子数组,返回...
分类:
其他好文 时间:
2014-05-24 22:19:17
阅读次数:
260
【题目】
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 maximum jump length at that position.
Determine if you are able to reach the last index.
For example:...
分类:
其他好文 时间:
2014-05-24 20:44:39
阅读次数:
221
本文介绍使用ImageMagick开发程序的方法。ImageMagick安装之后就可以支持C/C++程序的开发,提供了3种接口。在这里首先介绍一下ImageMagick的3种接口。
MagickCore:
底层的C语言接口。较复杂,但是可以修改很多参数,只适合高端用户使用。
MagickWand:
推荐的C语言接口。相比于MagickCore接口,简单很多。适合普通用户使用。
Magick++:
提供面向对象的C++接口。...
分类:
其他好文 时间:
2014-05-24 18:17:30
阅读次数:
342
一、什么是部署图?
部署图对面向对象系统的物理方面建模,描述系统运行时节点、构件实例及其对象的配置。主要用来在部署系统时涉及到的硬件(处理器和设备)进行建模。
二、部署图的组成元素?
部署图主要包括三种标记符:节点、构件和关联关系。
(1)节点:是计算机资源的通用名称,包括处理器和设备两种类型,两者的区别在于处理器能够执行程序的硬件构件(如服务器、工作站),而设备是一种不具备...
分类:
其他好文 时间:
2014-05-24 17:08:20
阅读次数:
273
【题目】
Given an array of non-negative integers, you are initially positioned at the first index of the array.
Given a collection of intervals, merge all overlapping intervals.
For example,
Given [1,3],[2,6],[8,10],[15,18],
return [1,6],[8,10],[15,18].
...
分类:
其他好文 时间:
2014-05-24 14:18:27
阅读次数:
193
一个面试题引发的思考:一个线程上直接调用了run()方法结果如何?我当时想的是抱方法找不到错误,今天测试了一下我错了!找了点资料学习了下,加上自己的理解整理如下(望指点)。(1)调用start:调用start()启动一个线程,该线程进入就绪状态,等待cpu分配执行时间,一旦得到执行时间就执行run(...
分类:
编程语言 时间:
2014-05-24 12:33:35
阅读次数:
322
快速排序是笔试面试经常问到的一个排序。因此首先来复习快速排序。时间复杂度:O(n*lgn)
最坏:O(n^2) 空间复杂度:O(lgn),最坏O(n) 不稳定。
分类:
编程语言 时间:
2014-05-24 11:21:29
阅读次数:
326