1 |
bearsoft |
1.1 |
#include "../../String/String.h"
|
2 |
|
|
#include "../../String/StringInput.h"
|
3 |
|
|
#include "../../System/System.h"
|
4 |
|
|
#include "../../LinkedList/StringLinkedList.h"
|
5 |
|
|
#include "../../LinkedList/IntLinkedList.h"
|
6 |
|
|
#include "LinkedListTest4.h"
|
7 |
|
|
#include "../../System/SystemDefine.h"
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
LinkedListTest4::LinkedListTest4(){}
|
11 |
|
|
LinkedListTest4::~LinkedListTest4(){}
|
12 |
|
|
|
13 |
|
|
void LinkedListTest4::run()
|
14 |
|
|
{
|
15 |
|
|
StringLinkedList *stringLinkedList = new StringLinkedList();
|
16 |
|
|
|
17 |
|
|
stringLinkedList->addLast("3.2f2");
|
18 |
|
|
stringLinkedList->addLast("4.2f");
|
19 |
|
|
stringLinkedList->addLast("3.2f");
|
20 |
|
|
stringLinkedList->addLast("3.f2");
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
int size=stringLinkedList->size();
|
24 |
|
|
|
25 |
|
|
String info="notSortedIntElement";
|
26 |
|
|
|
27 |
|
|
for ( int r=0; r<size ; r++ )
|
28 |
|
|
{
|
29 |
|
|
System::println(info + (r+1) + " Value=" + stringLinkedList->getElement(r));
|
30 |
|
|
}
|
31 |
|
|
|
32 |
|
|
stringLinkedList->sortSmallestOrder();
|
33 |
|
|
|
34 |
|
|
String info2="sortedIntElement";
|
35 |
|
|
|
36 |
|
|
for ( int r2=0; r2<size ; r2++ )
|
37 |
|
|
{
|
38 |
|
|
System::println(info2 + (r2+1) + " Value=" + stringLinkedList->getElement(r2));
|
39 |
|
|
}
|
40 |
|
|
|
41 |
|
|
|
42 |
|
|
delete stringLinkedList;
|
43 |
|
|
|
44 |
|
|
|
45 |
|
|
} |