binsort2.cpp

来自「datastucutre and algorithms, application」· C++ 代码 · 共 23 行

CPP
23
字号
// test bin sort as member of chain class

#include <iostream>
#include "studentRecord2.h"
#include "chainWithBinSort.h"

int main(void)
{
   studentRecord s;
   chain<studentRecord> theChain;
   for (int i = 1; i <= 20; i++)
   {
      s.score = i/2;
      s.name = new string(s.score, 'a');
      theChain.insert(0,s);
   }
   cout << "The unsorted chain is" << endl;
   cout << "  " << theChain << endl;
   theChain.binSort(10);
   cout << "The sorted chain is" << endl;
   cout << "  " << theChain << endl;
}

⌨️ 快捷键说明

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