- 博客(14)
- 收藏
- 关注
翻译 汇编用到的所有工具
Debug (command)——- debug is a command in DOS, OS/2 and Microsoft Windows (only in 32bit[1]) whic
2017-09-07 09:41:57
2198
翻译 对链表数据进行插入排序
Sort a linked list using insertion sort.class Solution {public: ListNode *insertionSortList(ListNode *head) { if(!head || !head->next)return head; ListNode dummyHead(0),*p;
2017-04-09 10:22:22
436
翻译 对链表数据归并排序
Sort a linked list in O(n log n) time using constant space complexity.//采用归并排序class Solution {public: ListNode* findMinddle(ListNode* head){ ListNode* slowPointer = head; Li
2017-04-09 10:20:15
310
翻译 二叉树先根遍历
Given a binary tree,return the preorder traversal of its nodes’ values.For example: given a binary tree (1,#,2,3);class Solution {public: vector<int> recursive(TreeNode* root, vector<int>& ivec){
2017-04-09 10:16:59
498
翻译 二叉树后序遍历
Given a binary tree, return the postorder traversal of its nodes’ values. 给定一个二叉树,返回后序遍历的节点值。For example: Given binary tree{1,#,2,3},//递归实现class Solution {public: void recursive (TreeNode* root
2017-03-29 17:09:44
290
翻译 栈,逆波兰表达式
Evaluate the value of an arithmetic expression in Reverse Polish Notation. 求一个用逆波兰表示的算数表达式的值。 Valid operators are+,-,*,/. Each operand may be an integer or another expression. 有效的操作是+,-,*,/。每一个操作数可以
2017-03-29 16:14:05
237
翻译 树的最小深度--牛客网
Description: Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. 提供一个二叉树,查找它的最小深度,这个最小深度大小是沿
2017-03-28 23:01:07
409
原创 make/makefie的简单使用方法
Makefile是一种配置文件, Makefile 一个工程中的源文件不计数,其按类型、功能、模块分别放在若干个目录中,makefile定义了一系列的规则来指定,哪些文件需要先编译,哪些文件需要后编译,哪些文件需要重新编译,甚至于进行更复杂的功能操作,因为 makefile就像一个Shell脚本一样//makefile 1 all:thread_1 2 3 CC=g++ 4 CPP
2017-02-07 22:35:25
517
原创 并发和并行 进程和线程的概念
并发和并行 ---并发指一个CPU可以异步的处理多个进程 ---并行则是一个CPU同时处理多个进程对于多核心CPU我们可以把系统看做是运行在准并行环境中的进程集合。在进程(程序)间快速反复切换叫做多任务处理。进程和线程进程是一个程序的实例。每个进程都有自己的虚拟地址空间和控制线程,线程是操作系统调度器(Schduler)分配处理器时间的基础单元。创建进程
2017-01-15 21:29:07
2262
原创 分治法求解最大数组
分治法求解最大数组假如我们要寻找Array[LOW...high]的最大数组,使用分治法意味着我们要将数组划分成两个规模尽量相等的子数组,也就是找到中央位置mid,然后求解Array[low,mid] 和Array[mid,high] ,Array[low...high] 的连续子数组Array[i..j]所处的位置必然只有三种情况:--完全位于左侧数组--完全位于
2017-01-15 11:18:30
464
原创 关于函数返回值的问题
返回局部变量,其实是拷贝的副本,所以没问题。返回“局部变量”的指针或引用,指针指向的内容会随函数失效,所以不妥。返回“指针”是没有问题的,指针的内容是存放在堆内存中的;返回局部数组,经测试返回数组也是没有问题的。数组和指针的联系: 数组要么在静态存储区被创建(如全局数组),要么在栈上被创建。数组名对应着(而不是指向)一块内存,其地址与容量在生命期内保持不变,只有数组的
2016-11-21 20:21:30
279
原创 vector初始化的形式和实现
初始化的形式:(1).vector v1;(2).vector v2(10);(3).vector v3(10,33); (4).vector v4{10};(5).vector v5{10};(6).vector v6{10,"A"};使用构造器实现()赋值:使用可变形参关键字initializer_list实现{ }进行赋值,{优快云:CODE:1
2016-11-21 18:47:11
265
转载 wx/msw/setup.h 错误
很多Windows下用Code::blocks+wxWidgets的朋友最开始的时候都会因为这个错误无法编译而放弃wx。下面给出详细解决方法: 1.到WX的目录下, 找到include\wx\platform.h文件,用Codeblocks打开它2.Codeblocks下用菜单栏的Search->Find功能, 找到 #include “wx/setup.h” 一行3.将 “wx/setup.h”
2016-06-25 15:19:42
652
1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人