摘要:        
#include #include using namespace std; class Operation { protected: double numberA; double numberB; public: double getA() { return numberA; } double getB() { return numberB; } void s...    阅读全文
posted @ 2016-11-30 21:26
沙加的孩子
阅读(238)
评论(0)
推荐(0)
        
            
        
        
摘要:        
//把每个值,插入到适合他的位置。插入的方法是:它前面的值往后移动。这个算法需要下标为0的位置作为哨兵#include void InsertSort(int *L) { int i, j; for (i = 2; i L[0]; j--) { L[j + 1] = L[j]; } L[j + 1] = L[0]; //因为循环最后的j--了 } }...    阅读全文
posted @ 2016-11-30 18:02
沙加的孩子
阅读(125)
评论(0)
推荐(0)
        
            
        
        
摘要:        
//记住适合位置i的下标,把它换过来#include void swap(int *a, int* b) { int tmp = 0; tmp = *a; *a = *b; *b = tmp; } //比较次数n(n-1)/2,交换次数n-1,时间复杂度为O(n2),但是比冒泡的效率高。因为冒泡的比较和交换次数之和是n(n-1) void SelectSort(int *L) { ...    阅读全文
posted @ 2016-11-30 18:00
沙加的孩子
阅读(104)
评论(0)
推荐(0)
        
            
        
        
摘要:        
#!/bin/bash #2.sh #编写shell脚本获取本机的网络地址。 #比如:本机的ip地址是:192.168.100.2/255.255.255.0,那么它的网络地址是192.168.100.1/255.255.255.0 #注意:Bcast与前面的Ip地址之间是两个空格,所以一定要把两个空格都删掉#grep后面的搜索词加不加引号都可以,如果是一个比较长,有空格的,比如inet add...    阅读全文
posted @ 2016-11-30 16:29
沙加的孩子
阅读(1952)
评论(0)
推荐(0)
        
 
                    
                     
                    
                 
                    
                
 
         浙公网安备 33010602011771号
浙公网安备 33010602011771号