- 博客(12)
- 收藏
- 关注
转载 c++中string&char *&char[]之间如何转换(示例)
本篇文章给大家带来的内容是关于C++中string&char *&char[]之间如何转换(示例),有一定的参考价值,有需要的朋友可以参考一下,希望对你有所帮助。 一、string转char*。 主要有三种方法可以将str转换为char*类型,分别是:data(); c_str(); copy(); 1.data()方法,如: 1 2 ...
2019-03-14 08:51:00 294
转载 Java多线程基础:进程和线程之由来
Java多线程基础:进程和线程之由来 在前面,已经介绍了Java的基础知识,现在我们来讨论一点稍微难一点的问题:Java并发编程。当然,Java并发编程涉及到很多方面的内容,不是一朝一夕就能够融会贯通使用的,需要在实践中不断积累。由于并发肯定涉及到多线程,因此在进入并发编程主题之前,我们先来了解一下进程和线程的由来,这对后面对并发编程的理解将会有很大的帮助。 下面是本文...
2016-03-10 15:27:00 73
转载 Win8博文
http://www.cnblogs.com/hebeiDGL/ 转载于:https://www.cnblogs.com/tomctx/archive/2012/10/13/2723143.html
2012-10-13 23:24:00 68
转载 贪心算法-活动安排
//《算法》P103 1 template <typename Type> 2 void greedySelector(int n, Type s[], Type f[], bool A[]) 3 { 4 A[1] = true; 5 int j = 1; 6 for(int i = 2; i <= n; ++ i){ ...
2012-05-01 15:57:00 182
转载 动态规划-0-1背包
1 #include <iostream> 2 #include <cstdlib> 3 #include<cstring> 4 using namespace std; 5 6 int max(int a, int b) 7 { 8 return (a >= b)? a : b; 9 } 10 ...
2012-05-01 15:48:00 66
转载 动态规划-矩阵连乘
《算法》P49 1 #include <stdio.h> 2 #include <stdlib.h> 3 #include<string.h> 4 //int m[102][102], s[102][102]; 5 void MatrixChain(int *p, int n, int m[][102], int s[][...
2012-05-01 11:08:00 96
转载 分治法-快速排序
#include <iostream> #include <cstdlib> #include<cstring> using namespace std; template<typename Type> int partition(Type a[], int low, int high) { //返回基准元素的...
2012-04-30 13:51:00 64
转载 分治法-归并排序
#include <iostream> #include <cstdlib> #include<cstring> using namespace std; #define LQ( a, b) ((a) <= (b)) #define EQ(a, b) ((a) == (b)) #define LT(a, b) ...
2012-04-29 15:53:00 63
转载 分治法-二分查找
对已排列好的非递减数组进行查找。 (1)非递归算法: #include <iostream> #include<cstdlib> using namespace std; template <typename Type> int binarySearch(Type a[], const Type &x, int n) ...
2012-04-29 13:29:00 200
转载 动态规划-最长公共子序列
《算法设计与分析》P56 1 #include<iostream> 2 #include<cstdlib> 3 using namespace std; 4 5 void LCSLength(int m, int n, char *x, char *y, int c[][10], int b[][10]) //定义函数时,*...
2012-04-20 11:41:00 79
转载 分治法-求最大最小元
用分治法求n个元素集合S中的最大、最小元素(要求每次平分成2个子集) void maxmin(int A[], int &e_max, int &e_min ,int low, int high) { int mid, x1, y1, x2, y2; if (high - low <= 1) { //<=,可...
2012-04-07 13:16:00 430
转载 《数据结构Chapter10·内部排序》
#include<stdio.h>#include<string.h>#include<stdlib.h>#define MAXSIZE 20typedef int Keytype;typedef struct{ Keytype key;// char *otherinfo;}Redtype;typedef struct{ Red...
2012-02-20 09:40:00 81
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人