Chinaunix首页 | 论坛 | 博客
  • 博客访问: 353482
  • 博文数量: 60
  • 博客积分: 15
  • 博客等级: 民兵
  • 技术积分: 1138
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-20 16:18
个人简介

最多140个字

文章分类

全部博文(60)

文章存档

2016年(1)

2015年(34)

2014年(25)

发布时间:2015-07-28 20:12:37

<p style="box-sizing:border-box;margin-top:0px;margin-bottom:10px;color:#333333;font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:14px;line-height:30px;white-space:normal;background-color:#FFFFFF;">Given a sorted array of integers, find the starting and ending position of a give.........【阅读全文】

阅读(1863) | 评论(0) | 转发(0)

发布时间:2015-07-11 13:01:40

https://leetcode.com/problems/word-frequency/<br /># Read from the file words.txt and output the word frequency list to stdout.<br />awk '{for(i=1;i&lt;=NF;i++){arr[$i]++}} END{for(w in arr){print w" "arr[w]}}' words.txt|sort -nrk 2<br />......【阅读全文】

阅读(2815) | 评论(0) | 转发(0)

发布时间:2015-06-26 21:14:30

<p style="margin-top:4px;margin-bottom:4px;padding-top:2px;padding-bottom:2px;font-family:Arial, Helvetica, sans-serif;font-size:12px;line-height:normal;white-space:normal;background-color:#FFFFFF;">//参考《Linux shell脚本攻略 第2版》</p><p style="margin-top:4px;margin-bottom:4px;padding-top:2px.........【阅读全文】

阅读(1774) | 评论(0) | 转发(0)

发布时间:2015-06-26 10:48:52

charttr能够将文件设置为不可修改。<br />1,使用下列命令将一个文件设置为不可修改:<br />ubuntu@VM-62-13-ubuntu:~$ sudo chattr +i test.sh<br /><br />2,这样test.sh文件就为不可修改状态:<br />ubuntu@VM-62-13-ubuntu:~$ sudo rm test.sh<br />rm: cannot remove ‘test.sh’: Operation not permitted<br /.........【阅读全文】

阅读(1966) | 评论(0) | 转发(0)

发布时间:2015-04-03 16:41:05

#includeusing namespace std;templateclass FreeList{    private:        FreeList* next;//空闲链表的下一个元素   &.........【阅读全文】

阅读(2361) | 评论(0) | 转发(0)

发布时间:2015-03-21 13:06:09

#include#includetypedef struct list{    int data;    struct list *next;}list;void swap(int *a,int *b){    int .........【阅读全文】

阅读(2212) | 评论(0) | 转发(0)

发布时间:2015-03-17 19:05:41

Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11' has binary representation 00000000000000000000000000001011, so the function should return 3.int hammingWeigh.........【阅读全文】

阅读(1830) | 评论(0) | 转发(0)

发布时间:2015-03-14 10:47:57

2013年,过的很充实,生活上如此,技术上亦是。这一年,看了很多的技术资料,技术上也有了很大的提高。而且,本着分享的精神,很多好的技术资料,也都在个人微博@何_登成 上做了推荐。今天,下定决心将整个2013年在微博上推荐的技术资料整理了一下,说真的,写的不少,看的更多。 下面的这些资料,都是.........【阅读全文】

阅读(2306) | 评论(0) | 转发(0)

发布时间:2015-03-04 13:42:27

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./** * Definition for singly-linked list. * struct ListNode { * int val; * struct ListNod.........【阅读全文】

阅读(1721) | 评论(0) | 转发(0)

发布时间:2015-03-04 12:40:33

Given two sorted integer arrays A and B, merge B into A as one sorted array.Note:You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B. The number of elements initialized in A and B are m andn respectiv.........【阅读全文】

阅读(1582) | 评论(0) | 转发(0)

发布时间:2015-03-04 10:51:13

double myPow(double x, int n) {        if(n==1)         return x;        if(n==0)  &nb.........【阅读全文】

阅读(2037) | 评论(0) | 转发(0)

发布时间:2014-06-10 09:26:51

本文分析了当对象作为函数参数时栈帧的结构并给出了栈帧结构的图示。点击(此处)折叠或打开//C++源码。//VC6.0#include#includeusing namespace std;class CBase{.........【阅读全文】

阅读(8744) | 评论(0) | 转发(0)

发布时间:2014-06-08 13:39:37

关于qsort函数对一维数组,二维数组(即字符串)的排序比较常见,本文介绍采用qsort函数对动态二维数组(如:char**p=new char*[2]; p[0]=new char[8];p[1]=new char[8];)进行排序。点击(此处)折叠或打开/* void qsort(void *base,int nelem,int width,int (*fcmp)(const void *.........【阅读全文】

阅读(9961) | 评论(0) | 转发(0)

发布时间:2014-05-10 14:34:36

C++中delete表达式执行的操作是:1,调用析构函数;2,释放对象内存。如果父类的析构函数没有声明为virtual函数,且子类中至少存在一个virtual函数,此时将子类的对象地址赋值给父类指针。当对父类的指针执行delete操作时,会调用父类析构函数,然后在释放内存时(即delete表达式执行的操作的2,释放对象内存)出现崩溃。.........【阅读全文】

阅读(6502) | 评论(0) | 转发(0)

发布时间:2014-05-07 12:59:18

点击(此处)折叠或打开//参考http://www.cnblogs.com/satng/archive/2010/12/30/2138833.html#includeusing namespace std;//thunk技术模拟typedef void (*fun)(void *,int i);.........【阅读全文】

阅读(2452) | 评论(0) | 转发(0)

发布时间:2014-04-28 19:48:40

点击(此处)折叠或打开#ifndef __BINARYSEARCHTREE_H__#define __BINARYSEARCHTREE_H__//templateclass BinarySearchTree{    private:   &.........【阅读全文】

阅读(2207) | 评论(0) | 转发(1)

发布时间:2014-04-23 12:56:44

1,二维数组:内存布局示例:点击(此处)折叠或打开int main(){    int p[3][4];    p[1][0]=123;    /*     1, p+1是.........【阅读全文】

阅读(4548) | 评论(0) | 转发(0)

发布时间:2014-04-22 10:56:49

......【阅读全文】

阅读(1833) | 评论(0) | 转发(0)

发布时间:2014-04-14 14:33:35

图示:点击(此处)折叠或打开//转载#include #include #include#define SKIPLIST_MAXLEVEL 8 typedef struct skiplistNode{ &nbs.........【阅读全文】

阅读(2043) | 评论(0) | 转发(0)

发布时间:2014-04-04 11:18:53

//数据结构与算法分析点击(此处)折叠或打开#includeint gcd1(int m,int n)//m>=n{    if(n==0)        return m;//printf("%d\n",m);.........【阅读全文】

阅读(1980) | 评论(0) | 转发(0)

发布时间:2014-04-03 18:25:49

点击(此处)折叠或打开int fun1(int i){    if(i......【阅读全文】

阅读(2058) | 评论(0) | 转发(0)

发布时间:2014-03-21 15:47:26

点击(此处)折叠或打开int a[10];n=10;------------------------------------------------//直接插入排序void InsertSort(int *a, int n)//下标从0开始。{    int i; .........【阅读全文】

阅读(2390) | 评论(0) | 转发(0)

发布时间:2014-03-20 18:45:20

点击(此处)折叠或打开//折半插入排序void BinaryInsertSort(int* a,int n)//下标从0开始。{    int i;    int j;    for(i=1;i......【阅读全文】

阅读(1825) | 评论(0) | 转发(0)

发布时间:2014-03-18 10:15:08

//C++ Primer 第四版1,C++使用链接指示(linkage directive)指出任意非C++函数所用的语言。2,链接指示有两种形式:单个的或复合的。链接指示不能出现在类定义或函数定义的内部,它必须出现在函数的第一次声明上。3,声明非C++函数:extern "C" size_t strlen(const char *);extern "C"{  &.........【阅读全文】

阅读(1808) | 评论(0) | 转发(0)

发布时间:2014-03-10 19:37:22

C++和Java中能使用重载函数,是因为编译器将每个唯一的方法和参数列表组合编码成一个对链接器来说唯一的名字,这种编码过程叫做毁坏(mangling),而相反的过程叫做恢复(demangling)。C++和Java使用兼容的毁坏策略。一个被毁坏的类名字是由名字中字符的整数数量,后面跟原始名字组成的,比如:类Foo被编码成3Foo.方.........【阅读全文】

阅读(1941) | 评论(0) | 转发(0)
给主人留下些什么吧!~~
留言热议
请登录后留言。

登录 注册