自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(130)
  • 资源 (5)
  • 收藏
  • 关注

转载 链表和数组的区别

构建: 数组必须事先定义固定的长度(元素个数),不能适应数据动态地增减的情况。当数据增加时,可能超出原先定义的元素个数;当数据减少时,造成内存浪费;数组可以根据下标直接存取。 链表动态地进行存储分配,可以适应数据动态地增减的情况,且可以方便地插入、删除数据项。(数组中插入、删除数据项时,需要移动其它数据项,非常繁琐)链表必须根据next指针找到下一个元素存储: 数组中的数据在

2015-05-04 13:39:18 857

转载 堆和栈的区别

一 、预备知识—程序的内存分配一个由C/C++编译的程序占用的内存分为以下几个部分 1、栈区(stack)—— 由编译器自动分配释放,存放函数的参数值,局部变量的值等。其 操作方式类似于数据结构中的栈。 2、堆区(heap)——一般由程序员分配释放, 若程序员不释放,程序结束时可能由OS回 收。注意它与数据结构中的堆是两回事,分配方式倒是类似于链表。 3、全局区(静态区)(st

2015-05-04 13:38:51 435

原创 解决VS打开弹窗问题save changes to the following items devenv sln

VS弹窗的处理方法

2016-05-13 09:23:50 4357 2

转载 电脑上使环境变量立即生效的方法

电脑上使环境变量立即生效的方法我的电脑>属性>高级>环境变量,添加新环境变量或修改已有的环境变量运行“DOS命令提示符”或run cmd,假设要修改PATH变量,不管PATH的原值是什么,在DOS窗口直接把PATH修改为任意值,关闭DOS窗口,这时,我的电脑>属性>高级>环境变量里PATH已经在Windows全局生效了。不用担心在DOS窗口的修改会影响我的电脑>属性>高级>环境变量里的修改,D

2015-09-17 09:14:03 878

转载 线程和进程

1.定义进程是具有一定独立功能的程序关于某个数据集合上的一次运行活动,进程是系统进行资源分配和调度的一个独立单位.线程是进程的一个实体,是CPU调度和分派的基本单位,它是比进程更小的能独立运行的基本单位.线程自己基本上不拥有系统资源,只拥有一点在运行中必不可少的资源(如程序计数器,一组寄存器和栈),但是它可与同属一个进程的其他的线程共享进程所拥有的全部资源.2.关系 一个线程可以创建和撤销另一个线

2015-08-11 20:49:38 446

转载 快速排序

面试必备:#include <string>#include <iostream>#include <stdio.h>using namespace std;void print(int a[], int n){ for(int j= 0; j<n; j++){ cout<<a[j] <<" "; } cout<<endl;}void quickS

2015-08-11 19:36:02 414

原创 【leetcode】Combination Sum III

Combination Sum III

2015-08-03 20:40:41 388

原创 【leetcode】Search a 2D Matrix II

Search a 2D Matrix II

2015-08-03 19:31:21 364

原创 【leetcode】Kth Smallest Element in a BST

Kth Smallest Element in a BST

2015-08-02 17:08:39 430

转载 【leetcode】Implement Queue using Stacks

Implement the following operations of a queue using stacks.push(x) – Push element x to the back of queue. pop() – Removes the element from in front of queue. peek() – Get the front element. empty()

2015-08-02 16:37:16 348

原创 【leetcode】Valid Anagram

Valid Anagram

2015-08-02 16:15:08 358

转载 Static变量和一般变量的区别

1. static的作用,和一般定义的全局变量的区别全局变量(外部变量)的说明之前再冠以static 就构成了静态的全局变量。全局变量本身就是静态存储方式, 静态全局变量当然也是静态存储方式。 这两者在存储方式上并无不同。 这两者的区别在于非静态全局变量的作用域是整个源程序, 当一个源程序由多个源文件组成时,非静态的全局变量在各个源文件中都是有效的。 而静态全局变量则限制了其作用域, 即只在定义该

2015-07-27 15:07:10 537

原创 【leetcode】Power of Two

Power of Two

2015-07-24 20:58:55 398

原创 【leetcode】Product of Array Except Self

Product of Array Except Self

2015-07-20 21:45:53 365

原创 【leetcode】Lowest Common Ancestor of a Binary Search Tree

Lowest Common Ancestor of a Binary Search Tree

2015-07-19 20:31:13 356

原创 【leetcode】Delete Node in a Linked List

Delete Node in a Linked

2015-07-19 19:57:10 411

原创 window7运行powershell

window运行poweshell

2015-07-19 19:30:53 752

原创 【leetcode】Contains Duplicate II

Contains Duplicate IIGiven an array of integers and an integer k, find out whether there there are two distinct indices i and j in the array such that nums[i] = nums[j] and the difference between iand

2015-06-04 21:14:06 468

原创 【leetcode】Convert Sorted List to Binary Search Tree

Convert Sorted List to Binary Search Tree思路: 可以参考下Convert Sorted Array to Binary Search Tree。但是list无法直接访问下标,需要进行一些处理,可以通过自下到顶的方式来写。注意的是: 函数传递参数为ListNode* &head (仅存在在函数的传递参数中), 表示函数结束之后,head的修改之仍有效,而L

2015-06-02 22:12:02 374

原创 【leetcode】Subsets 1&2

SubsetsGiven a set of distinct integers, nums, return all possible subsets. Note: • Elements in a subset must be in non-descending order. • The solution set must not contain duplicate subsets.

2015-06-02 20:02:19 477

原创 【leetcode】Jump Game II

Jump Game IIGiven 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. Your

2015-05-26 00:07:36 344

原创 【leetcode】Count and Say

Count and SayThe count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, … 1 is read off as “one 1” or 11. 11 is read off as “two 1s” or 21. 21 is read off

2015-05-25 21:01:24 384

原创 【leetcode】Rotate List

Rotate ListGiven a list, rotate the list to the right by k places, where k is non-negative. For example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->NULL. 需要注意的几点: 1)求链表长度的时候,千万注意是w

2015-05-25 20:26:07 335

原创 【leetcode】Contains Duplicate

Contains DuplicateGiven an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it should return false if

2015-05-25 19:35:37 361

原创 【leetcode】Letter Combinations of a Phone Number

Letter Combinations of a Phone NumberGiven a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telephone buttons) i

2015-05-25 00:09:20 330

原创 【leetcode】Longest Common Prefix

Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings. 思路: 1)找到最短的字符串,因为最长子串不会比这个长; 2)一个一个字符比较,直到有不同的,退出,输出resclass Solution {public: string

2015-05-24 19:53:57 320

原创 【leetcode】House Robber II

House Robber IINote: This is an extension of House Robber. After robbing those houses on that street, the thief has found himself a new place for his thievery so that he will not get too much attentio

2015-05-24 17:43:56 319

原创 【leetcode】Longest Consecutive Sequence

Longest Consecutive SequenceGiven an unsorted array of integers, find the length of the longest consecutive elements sequence. For example, Given [100, 4, 200, 1, 3, 2], The longest consecutive elem

2015-05-24 16:58:12 360

原创 【leetcode】Reverse Linked List II

Reverse Linked List IIReverse 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->5->NULL. Note: Given m

2015-05-19 15:49:58 340

原创 【leetcode】Multiply Strings

Multiply StringsGiven two numbers represented as strings, return multiplication of the numbers as a string. Note: The numbers can be arbitrarily large and are non-negative. 思路: 给定两个字符串的数字,进行相乘,然后输出结

2015-05-18 21:35:50 328

原创 【leetcode】Permutation Sequence

Permutation SequenceThe set [1,2,3,…,n] contains a total of n! unique permutations. By listing and labeling all of the permutations in order, We get the following sequence (ie, for n = 3): 1. “123”

2015-05-18 20:30:41 323

原创 【leetcode】Sqrt(x)

Sqrt(x)Implement int sqrt(int x). Compute and return the square root of x. 思路: 如果不知道二分之后左右的取法的话,可以找个实例进行推测。class Solution {public: int mySqrt(int x) { if(x<=1) return x; int lef

2015-05-18 19:21:47 376

转载 vetor, list, map, set的区别

List封装了链表,Vector封装了数组, list和vector得最主要的区别在于vector使用连续内存存储的,他支持[]运算符,而list是以链表形式实现的,不支持[]。 Vector对于随机访问的速度很快,但是对于插入尤其是在头部插入元素速度很慢,在尾部插入速度很快。List对于随机访问速度慢得多,因为可能要遍历整个链表才能做到,但是对于插入就快的多了,不需要拷贝和移动数据,只需要改变指

2015-05-18 18:47:04 635

原创 【leetcode】Combination Sum II

Combination Sum IIGiven a collection of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. Each number in C may only be used once i

2015-05-18 18:45:53 344

原创 【leetcode】Combination Sum

Combination SumGiven a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeated number may be chosen from C unli

2015-05-17 21:14:39 335

原创 【leetcode】Insertion Sort List

Insertion Sort ListSort a linked list using insertion sort. 思路: 其实这个就是一一比较,不过需要记录插入排序之前的节点和之后的节点,用四个节点来记录各个节点。特别注意对头节点的处理。/** * Definition for singly-linked list. * struct ListNode { * int val

2015-05-17 20:31:34 398

原创 【leetcode】Path Sum II

Path Sum II Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum. For example: Given the below binary tree and sum = 22, Return 思路: 用全局变量来记录r

2015-05-17 19:27:59 356

原创 【leetcode】Pow(x, n)

Pow(x, n)Implement pow(x, n). 思路: 思路就是递归,用简单递归的方法是O(n)的复杂度,但是如果二分之后再递归,复杂度为O(lg(n))。但是一定注意leetcode有个极限值-2147483648,如果要直接计算的话,就直接会出现无解的case,因此,需要把子函数的传递函数建立为long long形式。class Solution {public: do

2015-05-15 20:56:44 312

原创 【leetcode】Partition List

Partition ListGiven a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the original relative order of the nodes

2015-05-15 20:27:25 310

原创 【leetcode】Unique Paths II

Unique Paths II Follow up for “Unique Paths”: Now consider if some obstacles are added to the grids. How many unique paths would there be? An obstacle and empty space is marked as 1 and 0 respectiv

2015-05-15 19:38:47 321

北邮 孟祥武 高级操作系统课件&试题

北邮 孟祥武 高级操作系统课件&试题 有很好的借鉴价值和参考意义

2013-11-16

10个经典的Android开源项目(附源码包)

最近在抽空学习Android系统开发,对Android学习也比较感兴趣,刚开始学就试着在网上找几个项目源码研究看下,以下就将找到的Android项目源码列出,希望对正在或准备学习Android系统开发开发的能有些帮助! 1、Android团队提供的示例项目   如果不是从学习Android SDK中提供的那些样例代码开始,可能没有更好的方法来掌握在Android这个框架上开发。由Android的核心开发团队提供了15个优秀的示例项目,包含了游戏、图像处理、时间显示、开始菜单快捷方式等。   2、 Remote Droid   RemoteDroid是一个Android应用,能够让用户使用自己的无线网络使用无线键盘、触摸屏操作手机。这个项目为开发者提供了如网络连接、触摸屏手指运动等很好的样例。   3、 TorProxy和Shadow   TorProxy应用实现了Android手机无线电电传通讯(TOR),和Shadow应用一起使用,可以使用手机匿名上网。从该项目源代码中,可以掌握socket连接、管理cookie等方法。      4、 Android SMSPopup   SMSPopup可以截获短信内容显示在一个泡泡形状的窗口中。从这个项目中可以掌握到如何使用内置的短信SMS接口。   5、 Standup Timer   Standup Timer应用用于控制站立会议时间,类似秒表倒计时,可以提醒每个人的讲话时间已到,从而保证每个与会者使用时间一样。从该项目的代码中,可以学会如何使用时间函数。另外,这个项目的代码是采用视图view、模型model严格分离的设计思路。      6、 Foursquare   是Foursquare.com的一个客户端应用,该应用主要分为两个模块:API(com.joelapenna.foursquare)和界面前端 (com.joelapenna.foursquared)两部分。从该项目代码中,可以学会如何同步、多线程、HTTP连接等技术。   7、 Pedometer   Pedometer应用用于记录你每天走路步数的。尽管记录不一定精准,但是从这个项目中,可以学习几个不同的技术:加速器交互、语音更新、后台运行服务等。   8、 OpenSudoku-android   OpenSudoku是一个简单的九宫格数独游戏。从代码中可以学习到如何在视图中显示表格数据,以及如何和一个网站交互等技术。   9、 ConnectBot   ConnectBot是Android平台的一个客户端安全壳应用。从该项目代码中,可以学习到很多Android安全方面的内容,这些是你在开发应用时经常需要考虑的安全问题。   10、 WordPress的Android应用   当然在最后不能不提WordPress的Android应用了,这是WordPress官方开发团队提供的一个项目。从代码中可以学习到XMLRPC调用(当然还有更多的优秀内容)。

2012-03-15

串口通信编程实践

串口通信编程实践是配《 VC++ Turbo C串口通信编程实践》( 龚建伟)一书的

2011-12-21

VC++ Turbo C串口通信编程实践 龚建伟

VC++ Turbo C串口通信编程实践 龚建伟 非常详细

2011-12-21

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除