Sockets编程有三种: (1) 流步套接字(SOCK_STREAM); (2) 数据报套接字(SOCK_DGRAM); (3) 原始套接字(SOCK
2016-10-02二叉树的遍历方式(递归) 博客摘要: 1.什么是二叉树的遍历? 四种遍历是什么? 2.递归的实现二叉树的遍历; (下一篇博客将讲述三种遍历的非递归实现) 一. 什么是二叉树 简述:二叉树的每个结点至多只有二棵子树(不存在度大于2的结点),二叉树的子树有左右之分,次序不能颠倒。 例如下图: 二.四种遍历 本篇博客讲述二叉树的四种遍历:前
2016-10-02include <iostream> using namespace std; int main(int argc, char* argv[]) { cout << "请输入一个整数 " << endl; int i; cin >> i; cout << "八进制: " << oct <
2016-08-24include <iostream> using namespace std; 定义命名空间 namespace A { namespace B { string str = "AB "; } string str = "A "; } namespace B { string str = "B "; } int mai
2016-08-24include <iostream> using namespace std; ** * 交换变量 * void swap(int& x, int& y) { x = x ^ y; y = x ^ y; x = x ^ y; } int main(void) { int x = 3; 传递
2016-08-24include <iostream> using namespace std; void swap(int* const a, int* const b) { *a = *a ^ *b; *b = *a ^ *b; *a = *a ^ *b; } int main(void) { int x = 10; int const y = 10;
2016-08-24冒泡排序原理解析(小-大):从头开始,两个数相比较,如果一个数大于它的 后一个数,那么两数交换位置,一直比较到最后两个,下一次就会少排序一次。 概述:总是从排序的
2016-07-31