⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 testbubblesort.cpp

📁 C++编成数据结构与程序设计方法 D.S.Malk编著
💻 CPP
字号:
#include <iostream>
#include "searchSortAlgorithms.h"
 
using namespace std;

template <class elemType>
void print(elemType list[], int length);

int main()
{
    int intList[] = {2, 56, 34, 25, 73, 
                     46, 89, 10, 5, 16};         //Line 1

    cout << "Line 2: Before sorting, intList: "; //Line 2

    print(intList, 10);                          //Line 3

    cout << endl;                                //Line 4

    bubbleSort(intList, 10);                     //Line 5

    cout << "Line 6: After sorting, intList: ";  //Line 6

    print(intList, 10);                          //Line 7

    return 0;
}

template <class elemType>
void print(elemType list[], int length)
{
    for (int i = 0; i < length; i++)
        cout << list[i] << " ";

    cout << endl; 
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -