码迷,mamicode.com
首页 >  
搜索关键字:swap    ( 4231个结果
高斯消元与xor方程组
for(i=1;ia[i]) swap(a[i],a[j]); if(!a[i]) break; for(j=60;j>=0;j--) if(a[i]>>j&1) { for(k=1;k>j&1)) a[k]^=a[i]; break; }}对着这个代码思(...
分类:其他好文   时间:2015-01-18 17:00:14    阅读次数:194
常用的七大排序算法
1:冒泡排序: // BubbleSort.cpp : 定义控制台应用程序的入口点。 // #include "stdafx.h" #include using namespace std; /* 冒泡排序是稳定排序 时间复杂度是 O(n^2) */ void Swap(int& a, int& b) { int temp = a; a = ...
分类:编程语言   时间:2015-01-16 14:52:26    阅读次数:311
dx11 入门篇 Tutorial 01: 基本要素的创建 DirectXSampleBrowser(June 2010)
目标:这几天迅速入门dx11第一讲主要是基本要素的创建:device 、context、view、swap;笔记:1.In Direct3D 10, the device object was used to perform both rendering and resource creation....
分类:其他好文   时间:2015-01-16 14:35:43    阅读次数:575
排序算法
首先定义一个两个数对换的函数——swapvoid swap(int *a1, int *a2){ int tmp; tmp = *a1; *a1 = *a2; *a2 = tmp;}View Code1 插入排序:有一个已经有序的数据序列,要求在这个已经排好的数据序列中插入一...
分类:编程语言   时间:2015-01-14 22:41:20    阅读次数:229
【转】值传递、指针传递、引用传递的区别
1. 值传递:形参是实参的拷贝,改变形参的值并不会影响外部实参的值。从被调用函数的角度来说,值传递是单向的(实参->形参),参数的值只能传入,不能传出。当函数内部需要修改参数,并且不希望这个改变影响调用者时,采用值传递。void swap(int a,int b){ int temp; temp=a...
分类:其他好文   时间:2015-01-13 15:35:44    阅读次数:108
C++函数传递指向指针的指针的应用
传递指向指针的引用假设我们想编写一个与前面交换两个整数的 swap 类似的函数,实现两个指针的交换。已知需用 * 定义指针,用 & 定义引用。现在,问题在于如何将这两个操作符结合起来以获得指向指针的引用。这里给出一个例子: // swap values of two pointers to int ...
分类:编程语言   时间:2015-01-11 21:35:56    阅读次数:289
Linux磁盘管理
Swap分区设为物理内存的2~2.5倍sd和hd两种:sd表示STAT硬盘,hd表示IDE硬盘;SCSI硬盘和U盘也是sdBoot分区存放操作系统的内核根分区、/boot分区、/var分区、swap分区可以避免日志文件大小失控根分区、/boot分区、 /home分区、swap分区对于一台为许多用户提...
分类:系统相关   时间:2015-01-11 16:08:15    阅读次数:354
LeetCode---Swap Nodes in Pairs
Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space. Y...
分类:其他好文   时间:2015-01-10 13:57:24    阅读次数:119
leetcode 【 Swap Nodes in Pairs 】python 实现
题目:Given a linked list, swap every two adjacent nodes and return its head.For example,Given1->2->3->4, you should return the list as2->1->4->3.Your al...
分类:编程语言   时间:2015-01-10 00:57:36    阅读次数:327
排列组合的代码总结篇
#include #include using namespace std;void my_swap(vector &a,int i,int j){ int temp=a[i]; a[i]=a[j]; a[j]=temp;}vector v;int n;void printPrem...
分类:其他好文   时间:2015-01-09 14:12:53    阅读次数:113
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!