├── .gitignore ├── LICENSE ├── README.md ├── VisualizationOfSortingAlgorithms.pro ├── includes ├── algorithms.h └── visualization.h ├── preview ├── gif │ ├── 0.gif │ ├── 1.gif │ ├── 2.gif │ ├── 3.gif │ └── 4.gif └── ic_youtube.svg └── src ├── algorithms.cpp ├── main.cpp ├── visualization.cpp └── widget.ui /.gitignore: -------------------------------------------------------------------------------- 1 | # C++ objects and libs 2 | 3 | *.slo 4 | *.lo 5 | *.o 6 | *.a 7 | *.la 8 | *.lai 9 | *.so 10 | *.dll 11 | *.dylib 12 | 13 | # Qt-es 14 | 15 | /.qmake.cache 16 | /.qmake.stash 17 | *.pro.user 18 | *.pro.user.* 19 | *.qbs.user 20 | *.qbs.user.* 21 | *.moc 22 | moc_*.cpp 23 | moc_*.h 24 | qrc_*.cpp 25 | ui_*.h 26 | Makefile* 27 | *build-* 28 | 29 | # QtCreator 30 | 31 | *.autosave 32 | 33 | # QtCtreator Qml 34 | *.qmlproject.user 35 | *.qmlproject.user.* 36 | 37 | # QtCtreator CMake 38 | CMakeLists.txt.user* 39 | 40 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 Bruno Kawka 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 |

Visualization of sorting algorithms

3 |

Visualize the most popular algorithms on your desktop screen

4 | 5 | #### About 6 | 7 | The app visualizes the sorting process of the most popular sorting algorithms. It generates a defined number of columns in the shape of a right-angled triangle and mixes them up. On the start button click, the chosen algorithm is sorting columns by ascending height. 8 | 9 | #### Install 10 | 11 | All of available install methods are listed below. 12 | 13 | ##### Download 14 | 15 | click me to visit download site
16 | 17 | ##### Instruction 18 | 1. Download software 19 | 2. Run .exe file 20 | 3. Enjoy! 21 | 22 | #### Usage 23 | 24 | * **select** sorting algorithm which you would like to see in the action 25 | * (optional) **specify** amount of columns and delay (ms) 26 | 27 | #### Examples 28 | 29 | There's some preview of sorting alogorithms in action. 30 | 31 | Cocktail Sort - 100 columns 1 ms | Gnome Sort - 100 columns 1 ms 32 | :----------------------------:|:----------------------------: 33 | ![Bubble Sort](./preview/gif/1.gif) | ![Bubble Sort](./preview/gif/2.gif) 34 | 35 | Quick Sort - 50 columns 20 ms | Heap Sort - 500 columns 1 ms 36 | :----------------------------:|:----------------------------: 37 | ![Quick Sort](./preview/gif/3.gif) | ![Bubble Sort](./preview/gif/0.gif) 38 | 39 |

Watch YouTube video for more! 40 | -------------------------------------------------------------------------------- /VisualizationOfSortingAlgorithms.pro: -------------------------------------------------------------------------------- 1 | #------------------------------------------------- 2 | # 3 | # Project created by QtCreator 2017-11-18T15:15:59 4 | # 5 | #------------------------------------------------- 6 | 7 | QT += core gui 8 | 9 | greaterThan(QT_MAJOR_VERSION, 4): QT += widgets 10 | 11 | TARGET = find 12 | TEMPLATE = app 13 | 14 | # The following define makes your compiler emit warnings if you use 15 | # any feature of Qt which has been marked as deprecated (the exact warnings 16 | # depend on your compiler). Please consult the documentation of the 17 | # deprecated API in order to know how to port your code away from it. 18 | DEFINES += QT_DEPRECATED_WARNINGS 19 | 20 | # You can also make your code fail to compile if you use deprecated APIs. 21 | # In order to do so, uncomment the following line. 22 | # You can also select to disable deprecated APIs only up to a certain version of Qt. 23 | #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 24 | 25 | 26 | SOURCES += \ 27 | src\main.cpp \ 28 | src\visualization.cpp \ 29 | src\algorithms.cpp 30 | 31 | HEADERS += \ 32 | includes\visualization.h \ 33 | includes\algorithms.h 34 | 35 | FORMS += \ 36 | src\widget.ui 37 | 38 | QMAKE_CXXFLAGS += -std=gnu++14 39 | -------------------------------------------------------------------------------- /includes/algorithms.h: -------------------------------------------------------------------------------- 1 | #ifndef THREAD_H 2 | #define THREAD_H 3 | 4 | #include 5 | #include 6 | 7 | class Thread : public QThread 8 | { 9 | Q_OBJECT 10 | public: 11 | Thread(int, int, int, std::vector, QObject*); 12 | 13 | signals: 14 | void comparision(int, int); 15 | void sortDone(int); 16 | void arrayAccess(int); 17 | void changeButtonStatus(int); 18 | 19 | protected: 20 | void run() override; 21 | 22 | private: 23 | std::vector columnsHeight; 24 | int sortDoneDelay; 25 | int sortDelay; 26 | int amount; 27 | int sortWith; 28 | int arrayAccessVariable; 29 | 30 | void swap(int, int); 31 | void isAccessToArray(); 32 | void Sorted(); 33 | 34 | //sorting algorithms declaration 35 | void BubbleSort(); 36 | void RecursiveBubbleSort(int); 37 | void CocktailSort(); 38 | void GnomeSort(); 39 | 40 | int QuickSortPartition(int, int); 41 | void QuickSort(int, int); 42 | 43 | void Heapify(int n, int i); 44 | void HeapSort(); 45 | }; 46 | 47 | #endif // THREAD_H 48 | -------------------------------------------------------------------------------- /includes/visualization.h: -------------------------------------------------------------------------------- 1 | #ifndef WIDGET_H 2 | #define WIDGET_H 3 | 4 | #include 5 | #include 6 | 7 | #include "algorithms.h" 8 | 9 | namespace Ui { 10 | class Widget; 11 | } 12 | 13 | class Thread; 14 | 15 | class Widget : public QWidget 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | explicit Widget(QWidget *parent = nullptr); 21 | ~Widget(); 22 | 23 | private slots: 24 | void on_sortButton_clicked(); 25 | void on_algorithmSelection_itemClicked(QListWidgetItem*); 26 | void on_amountChanger_valueChanged(int); 27 | void on_delayChanger_valueChanged(int); 28 | 29 | void on_comparision(int, int); 30 | void sortButtonStatus(int); 31 | void sortDone(int); 32 | void resetColumns(int, int); 33 | 34 | private: 35 | Ui::Widget *ui; 36 | Thread *mThread; 37 | QGraphicsScene *scene; 38 | 39 | //setting up columns, shuffeling them 40 | void columnsSetUp(int, int); 41 | void threadUpdate(int, int); 42 | 43 | std::vector columns; 44 | std::vector columnsHeight; 45 | 46 | QMap AlgorithmList; 47 | 48 | //delay of sorting in ms 49 | int sortDelay; 50 | 51 | double columnsWidth; 52 | double sceneHeight; 53 | double sceneWidth; 54 | 55 | int amountOfColumns; 56 | int comparisions; 57 | 58 | //key which is use to establish the algorithm to sort columns 59 | int algorithmKey; 60 | 61 | // (-1) - App started, 0 - App ready to sort, (1) - App sorting, (2) - App sorted 62 | int appStates; 63 | }; 64 | 65 | #endif // WIDGET_H 66 | -------------------------------------------------------------------------------- /preview/gif/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letelete/visualization-of-sorting-algorithms/e2521d66c7b842c4350475834227a8c8a7c43e22/preview/gif/0.gif -------------------------------------------------------------------------------- /preview/gif/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letelete/visualization-of-sorting-algorithms/e2521d66c7b842c4350475834227a8c8a7c43e22/preview/gif/1.gif -------------------------------------------------------------------------------- /preview/gif/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letelete/visualization-of-sorting-algorithms/e2521d66c7b842c4350475834227a8c8a7c43e22/preview/gif/2.gif -------------------------------------------------------------------------------- /preview/gif/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letelete/visualization-of-sorting-algorithms/e2521d66c7b842c4350475834227a8c8a7c43e22/preview/gif/3.gif -------------------------------------------------------------------------------- /preview/gif/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/letelete/visualization-of-sorting-algorithms/e2521d66c7b842c4350475834227a8c8a7c43e22/preview/gif/4.gif -------------------------------------------------------------------------------- /preview/ic_youtube.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/algorithms.cpp: -------------------------------------------------------------------------------- 1 | #include "includes/algorithms.h" 2 | 3 | Thread::Thread(int ms, int alg, int n, std::vector col, QObject *parent = nullptr) : QThread(parent) 4 | { 5 | sortWith = alg; 6 | amount = n; 7 | columnsHeight = col; 8 | arrayAccessVariable = 0; 9 | 10 | sortDoneDelay = (amount >= 300 ? 2 : 5); 11 | sortDelay = ms; 12 | } 13 | 14 | void Thread::run() 15 | { 16 | switch(sortWith) 17 | { 18 | case 0: BubbleSort(); break; 19 | case 1: RecursiveBubbleSort(amount); break; 20 | case 2: CocktailSort(); break; 21 | case 3: GnomeSort(); break; 22 | case 4: QuickSort(0, amount -1); break; 23 | case 5: HeapSort(); break; 24 | } 25 | Sorted(); 26 | } 27 | 28 | void Thread::Sorted() 29 | { 30 | for(auto i=0; i columnsHeight[j+1]) 58 | swap(j, j+1); 59 | 60 | isAccessToArray(); 61 | msleep(sortDelay); 62 | } 63 | } 64 | 65 | //--------- RECURSIVE BUBBLE SORT - 66 | 67 | void Thread::RecursiveBubbleSort(int n) 68 | { 69 | if (n == 1) 70 | return; 71 | 72 | for (int i=0; i columnsHeight[i+1]) 75 | swap(i, i+1); 76 | 77 | isAccessToArray(); 78 | msleep(sortDelay); 79 | } 80 | RecursiveBubbleSort(n-1); 81 | } 82 | 83 | //--------- COCKTAIL SORT --------- 84 | 85 | void Thread::CocktailSort() 86 | { 87 | bool swapped = true; 88 | auto start = 0; 89 | auto end = amount-1; 90 | 91 | while(swapped) 92 | { 93 | swapped = false; 94 | for (auto i = start; i < end; i++) 95 | { 96 | if(columnsHeight[i] > columnsHeight[i + 1]) 97 | { 98 | swap(i, i+1); 99 | swapped = true; 100 | } 101 | isAccessToArray(); 102 | msleep(sortDelay); 103 | } 104 | 105 | if (!swapped) 106 | break; 107 | 108 | swapped = false; 109 | end--; 110 | 111 | for (auto i = end-1; i >= start; i--) 112 | { 113 | if (columnsHeight[i] > columnsHeight[i + 1]) 114 | { 115 | swap(i, i+1); 116 | swapped = true; 117 | } 118 | isAccessToArray(); 119 | msleep(sortDelay); 120 | } 121 | start++; 122 | } 123 | } 124 | 125 | //--------- GNOME SORT ------------ 126 | 127 | void Thread::GnomeSort() 128 | { 129 | int index = 0; 130 | 131 | while (index < amount) 132 | { 133 | if (index == 0) 134 | index++; 135 | if (columnsHeight[index] >= columnsHeight[index-1]) 136 | index++; 137 | else 138 | { 139 | swap(index, index-1); 140 | index--; 141 | } 142 | isAccessToArray(); 143 | msleep(sortDelay); 144 | } 145 | } 146 | 147 | //--------- QUICK SORT ------------ 148 | 149 | int Thread::QuickSortPartition(int arrayBegin, int arrayEnd) 150 | { 151 | auto pivot = columnsHeight[arrayEnd]; 152 | auto i = (arrayBegin - 1); 153 | 154 | for (auto j = arrayBegin; j <= arrayEnd - 1; j++) 155 | { 156 | if (columnsHeight[j] <= pivot) 157 | { 158 | i++; 159 | swap(i, j); 160 | } 161 | 162 | isAccessToArray(); 163 | msleep(sortDelay); 164 | } 165 | 166 | swap(i+1, arrayEnd); 167 | 168 | msleep(sortDelay); 169 | return(i + 1); 170 | } 171 | 172 | void Thread::QuickSort(int arrayBegin, int arrayEnd) 173 | { 174 | if (arrayBegin < arrayEnd) 175 | { 176 | auto pi = QuickSortPartition(arrayBegin, arrayEnd); 177 | 178 | QuickSort(arrayBegin, pi - 1); 179 | QuickSort(pi + 1, arrayEnd); 180 | } 181 | } 182 | 183 | //--------- HEAP SORT ------------- 184 | 185 | void Thread::Heapify(int n, int i) 186 | { 187 | int largest = i; 188 | int l = 2*i + 1; 189 | int r = 2*i + 2; 190 | 191 | if (l < n && columnsHeight[l] > columnsHeight[largest]) 192 | largest = l; 193 | 194 | isAccessToArray(); 195 | 196 | if (r < n && columnsHeight[r] > columnsHeight[largest]) 197 | largest = r; 198 | 199 | isAccessToArray(); 200 | 201 | if (largest != i) 202 | { 203 | swap(i, largest); 204 | Heapify(n, largest); 205 | 206 | msleep(sortDelay); 207 | } 208 | } 209 | 210 | void Thread::HeapSort() 211 | { 212 | auto n = amount; 213 | 214 | for (int i = n / 2 - 1; i >= 0; i--) 215 | { 216 | Heapify(n, i); 217 | } 218 | 219 | for (int i=n-1; i>=0; i--) 220 | { 221 | swap(0, i); 222 | msleep(sortDelay); 223 | Heapify(i, 0); 224 | } 225 | } 226 | -------------------------------------------------------------------------------- /src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "includes/visualization.h" 2 | #include 3 | 4 | int main(int argc, char *argv[]) 5 | { 6 | QApplication a(argc, argv); 7 | Widget w; 8 | w.show(); 9 | 10 | return a.exec(); 11 | } 12 | -------------------------------------------------------------------------------- /src/visualization.cpp: -------------------------------------------------------------------------------- 1 | #include "includes/visualization.h" 2 | #include "ui_widget.h" 3 | 4 | #include 5 | #include 6 | 7 | Widget::Widget(QWidget *parent) : 8 | QWidget(parent), 9 | ui(new Ui::Widget) 10 | { 11 | ui->setupUi(this); 12 | 13 | //setting up scene 14 | scene = new QGraphicsScene(this); 15 | ui->cellsToSortBackground->setScene(scene); 16 | ui->cellsToSortBackground->verticalScrollBar()->blockSignals(true); 17 | ui->cellsToSortBackground->horizontalScrollBar()->blockSignals(true); 18 | 19 | //configuring variables 20 | appStates = -1; // (-1) - App started 21 | 22 | sceneHeight = ui->cellsToSortBackground->size().height(); 23 | sceneWidth = ui->cellsToSortBackground->size().width(); 24 | comparisions = 0; 25 | 26 | //customize the ListWidget & set a QMap for sorting algorithms 27 | for(int i = 0; i < ui->algorithmSelection->count(); i++) 28 | { 29 | QListWidgetItem *item = ui->algorithmSelection->item(i); 30 | item->setSizeHint(QSize(item->sizeHint().width(), 50)); 31 | AlgorithmList.insert(i, item->text()); 32 | } 33 | 34 | //to improve UX 35 | ui->amountChanger->setDisabled(true); 36 | ui->delayChanger->setDisabled(true); 37 | ui->sortButton->setDisabled(true); 38 | 39 | //creating 100 columns with sorting delay == 1ms , setting them up 40 | columnsSetUp(1, 100); 41 | } 42 | 43 | void Widget::columnsSetUp(int ms, int n) 44 | { 45 | //configuring variables 46 | ui->LabelComparisions_var->setNum(0); 47 | ui->LabelArrayAccesses_var->setNum(0); 48 | 49 | sortDelay = ms; 50 | amountOfColumns = n; 51 | columnsWidth = sceneWidth / amountOfColumns; 52 | 53 | //setting up columns to sort 54 | columns.resize(static_cast(amountOfColumns)); 55 | 56 | //setting up columns height 57 | double incrementBy = sceneHeight / amountOfColumns; 58 | for(auto i = incrementBy; i <= sceneHeight; i += incrementBy) 59 | columnsHeight.push_back(i); 60 | 61 | //randomize an array 62 | std::random_device m_random; 63 | std::mt19937 e_random(m_random()); 64 | std::shuffle(columnsHeight.begin(), columnsHeight.end(), e_random); 65 | 66 | //aplying columns to scene 67 | auto j = 0; 68 | auto k = 0.0; 69 | for(auto &p : columns) 70 | { 71 | p = new QGraphicsRectItem; 72 | p->setRect(k, (sceneHeight - columnsHeight[j]), columnsWidth , columnsHeight[j]); 73 | p->setBrush(QBrush(QColor(255, 0, 68, 255))); 74 | 75 | if(amountOfColumns <= 200) 76 | p->setPen(QPen(Qt::black, 2)); 77 | else if(amountOfColumns > 200 && amountOfColumns <= 300) 78 | p->setPen(QPen(Qt::black, 1)); 79 | else 80 | p->setPen(Qt::NoPen); 81 | 82 | scene->addItem(p); 83 | 84 | j++; 85 | k += columnsWidth; 86 | } 87 | } 88 | 89 | void Widget::resetColumns(int ms, int n) 90 | { 91 | for(auto &p : columns) 92 | scene->removeItem(p); 93 | 94 | columnsHeight.clear(); 95 | 96 | columnsSetUp(ms, n); 97 | threadUpdate(sortDelay, algorithmKey); 98 | } 99 | 100 | void Widget::threadUpdate(int ms, int key) 101 | { 102 | mThread = new Thread(ms, key, static_cast(amountOfColumns), columnsHeight, this); 103 | 104 | connect(mThread, SIGNAL(comparision(int, int)), this, SLOT(on_comparision(int, int))); 105 | connect(mThread, SIGNAL(sortDone(int)), this, SLOT(sortDone(int))); 106 | connect(mThread, SIGNAL(arrayAccess(int)), ui->LabelArrayAccesses_var, SLOT(setNum(int))); 107 | connect(mThread, SIGNAL(changeButtonStatus(int)), this, SLOT(sortButtonStatus(int))); 108 | } 109 | 110 | void Widget::on_algorithmSelection_itemClicked(QListWidgetItem *item) 111 | { 112 | if(appStates == -1) 113 | { 114 | ui->sortButton->setEnabled(true); 115 | ui->amountChanger->setEnabled(true); 116 | ui->delayChanger->setEnabled(true); 117 | 118 | appStates = 0; 119 | sortButtonStatus(appStates); 120 | } 121 | 122 | if(appStates == 0) 123 | { 124 | algorithmKey = AlgorithmList.key(item->text()); 125 | ui->LabelSortingWith_var->setText(item->text()); 126 | } 127 | } 128 | 129 | void Widget::on_amountChanger_valueChanged(int n) 130 | { 131 | if(appStates == 0) 132 | resetColumns(sortDelay, n); 133 | } 134 | 135 | void Widget::on_delayChanger_valueChanged(int ms) 136 | { 137 | if(appStates == 0) 138 | resetColumns(ms, static_cast(amountOfColumns)); 139 | } 140 | 141 | 142 | void Widget::on_sortButton_clicked() 143 | { 144 | switch(appStates) 145 | { 146 | case 0: 147 | sortButtonStatus(1); 148 | comparisions = 0; 149 | threadUpdate(sortDelay, algorithmKey); 150 | mThread->start(); 151 | break; 152 | 153 | case 1: 154 | mThread->terminate(); 155 | sortButtonStatus(2); 156 | break; 157 | 158 | case 2: 159 | for(auto &p : columns) 160 | scene->removeItem(p); 161 | 162 | columnsHeight.clear(); 163 | columnsSetUp(sortDelay, static_cast(amountOfColumns)); 164 | sortButtonStatus(0); 165 | break; 166 | 167 | default: 168 | break; 169 | } 170 | } 171 | 172 | void Widget::sortButtonStatus(int state) 173 | { 174 | QString buttonText; 175 | QString style; 176 | 177 | switch(state) 178 | { 179 | case 0: 180 | buttonText = "sort"; 181 | ui->amountChanger->setEnabled(true); 182 | ui->delayChanger->setEnabled(true); 183 | ui->algorithmSelection->setEnabled(true); 184 | style = "background-color: rgba(255, 0, 68, 255); color: #fff"; 185 | break; 186 | 187 | case 1: 188 | buttonText = "cancel"; 189 | ui->amountChanger->setDisabled(true); 190 | ui->delayChanger->setDisabled(true); 191 | ui->algorithmSelection->setDisabled(true); 192 | style = "background-color: #000; color: #fff"; 193 | break; 194 | 195 | case 2: 196 | buttonText = "new sort"; 197 | ui->sortButton->setEnabled(true); 198 | style = "background-color: rgb(85, 0, 255); color: #fff"; 199 | break; 200 | } 201 | 202 | appStates = state; 203 | ui->sortButton->setText(buttonText); 204 | ui->sortButton->setStyleSheet(style); 205 | } 206 | 207 | void Widget::on_comparision(int n, int k) 208 | { 209 | auto nRect = columns[n]->rect(); 210 | auto kRect = columns[k]->rect(); 211 | auto nColumnPos = nRect.left(); 212 | auto kColumnPos = kRect.left(); 213 | 214 | nRect.moveLeft(kColumnPos); 215 | kRect.moveLeft(nColumnPos); 216 | 217 | columns[n]->setRect(nRect); 218 | columns[k]->setRect(kRect); 219 | 220 | std::swap(columns[n], columns[k]); 221 | 222 | comparisions++; 223 | ui->LabelComparisions_var->setNum(comparisions); 224 | } 225 | 226 | void Widget::sortDone(int n) 227 | { 228 | columns[n]->setBrush(QBrush(QColor(0,200,0))); 229 | } 230 | 231 | Widget::~Widget() 232 | { 233 | mThread->terminate(); 234 | delete ui; 235 | } 236 | -------------------------------------------------------------------------------- /src/widget.ui: -------------------------------------------------------------------------------- 1 | 2 | 3 | Widget 4 | 5 | 6 | 7 | 0 8 | 0 9 | 1374 10 | 720 11 | 12 | 13 | 14 | Widget 15 | 16 | 17 | QWidget { 18 | background-color: #fff; 19 | font: 25 11pt "Roboto Light"; 20 | color: rgba(0, 0, 0, 100); 21 | } 22 | 23 | #sortButton { 24 | border:none; 25 | background-color: rgba(255, 0, 68,100); 26 | border-radius: 15%; 27 | font: 11pt "Roboto"; 28 | color: #fff; 29 | } 30 | 31 | #amountChanger, #delayChanger { 32 | padding-right: 10px; 33 | padding-left: 10px; 34 | border: 1px solid rgba(255, 0, 68, 150); 35 | border-radius: 3%; 36 | background-color: #f5f5f5; 37 | font: 11pt "Roboto"; 38 | color: rgb(255, 0, 68); 39 | } 40 | 41 | #amountChanger::up-button:pressed, #amountChanger::down-button:pressed, 42 | #delayChanger ::up-button:pressed, #delayChanger::down-button:pressed{ 43 | background-color: rgab(220, 0, 58, 255); 44 | } 45 | 46 | #amountChanger::up-button, #amountChanger::down-button, 47 | #delayChanger::up-button, #delayChanger::down-button { 48 | width: 16px; 49 | background-color: rgba(255, 0, 68, 150); 50 | } 51 | #amountChanger::down-button, 52 | #delayChanger::down-button { 53 | border-top: 1px solid rgba(255, 0, 68, 180); 54 | } 55 | 56 | #amountChanger::down-button:hover, #amountChanger::up-button:hover, 57 | #delayChanger::down-button:hover, #delayChanger::up-button:hover { 58 | background-color:rgba(255, 0, 68, 255); 59 | } 60 | 61 | #amountChanger::up-button:disabled,#amountChanger::up-button:off, 62 | #amountChanger::down-button:disabled,#amountChanger::down-button:off, 63 | #delayChanger::up-button:disabled,#delayChanger::up-button:off, 64 | #delayChanger::down-button:disabled,#delayChanger::down-button:off{ 65 | background-color: rgba(0, 0, 0, 20) 66 | } 67 | 68 | #amountChanger::down-button:disabled,#amountChanger::down-button:off, 69 | #delayChanger::down-button:disabled,#delayChanger::down-button:off{ 70 | border-top: 1px solid rgba(0, 0, 0, 20); 71 | } 72 | #amountChanger:disabled, #amountChanger:off, 73 | #delayChanger:disabled, #delayChanger:off{ 74 | border: 1px solid rgba(0, 0, 0, 20); 75 | color: rgba(0, 0, 0, 50); 76 | } 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 0 86 | 0 87 | 88 | 89 | 90 | 91 | 1000 92 | 700 93 | 94 | 95 | 96 | 97 | background-color:rgb(31, 31, 31) 98 | 99 | 100 | QFrame::NoFrame 101 | 102 | 103 | Qt::ScrollBarAlwaysOff 104 | 105 | 106 | Qt::ScrollBarAlwaysOff 107 | 108 | 109 | Qt::AlignCenter 110 | 111 | 112 | QPainter::Antialiasing|QPainter::HighQualityAntialiasing|QPainter::TextAntialiasing 113 | 114 | 115 | 116 | 117 | 118 | 119 | Qt::Horizontal 120 | 121 | 122 | QSizePolicy::Preferred 123 | 124 | 125 | 126 | 40 127 | 20 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 0 137 | 0 138 | 139 | 140 | 141 | 142 | 143 | 144 | QFrame::StyledPanel 145 | 146 | 147 | QFrame::Raised 148 | 149 | 150 | 151 | 152 | 153 | Qt::Vertical 154 | 155 | 156 | QSizePolicy::Fixed 157 | 158 | 159 | 160 | 20 161 | 40 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | QLayout::SetMinimumSize 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | <html><head/><body><p>Array Accesses:</p></body></html> 178 | 179 | 180 | 181 | 182 | 183 | 184 | color: rgba(0, 0, 0, 150); 185 | 186 | 187 | <html><head/><body><p>0</p></body></html> 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | QLayout::SetMinimumSize 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | <html><head/><body><p>Comparisions:</p></body></html> 205 | 206 | 207 | 208 | 209 | 210 | 211 | color: rgba(0, 0, 0, 150); 212 | 213 | 214 | <html><head/><body><p>0</p></body></html> 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | QLayout::SetMinimumSize 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | <html><head/><body><p>Sorting with:</p></body></html> 232 | 233 | 234 | 235 | 236 | 237 | 238 | color: rgba(0, 0, 0, 150); 239 | 240 | 241 | <html><head/><body><p>Select an algorithm..</p></body></html> 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | Qt::Vertical 251 | 252 | 253 | QSizePolicy::Fixed 254 | 255 | 256 | 257 | 20 258 | 40 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | <html><head/><body><p>Amount of columns</p></body></html> 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 0 280 | 0 281 | 282 | 283 | 284 | 285 | 0 286 | 0 287 | 288 | 289 | 290 | PointingHandCursor 291 | 292 | 293 | 294 | 295 | 296 | false 297 | 298 | 299 | 50 300 | 301 | 302 | 500 303 | 304 | 305 | 50 306 | 307 | 308 | 100 309 | 310 | 311 | 10 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | <html><head/><body><p>Delay</p></body></html> 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 0 334 | 0 335 | 336 | 337 | 338 | 339 | 68 340 | 0 341 | 342 | 343 | 344 | PointingHandCursor 345 | 346 | 347 | 348 | 349 | 350 | 1 351 | 352 | 353 | 20 354 | 355 | 356 | 1 357 | 358 | 359 | 1 360 | 361 | 362 | 10 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | border: 1px solid rgba(0,0,0,30); 372 | padding-top: 20px; 373 | padding-left: 5px; 374 | padding-right: 5px; 375 | color: rgba(0,0,0,120); 376 | font: 87 14pt "Roboto Light"; 377 | 378 | 379 | QFrame::StyledPanel 380 | 381 | 382 | QFrame::Sunken 383 | 384 | 385 | Qt::ScrollBarAlwaysOff 386 | 387 | 388 | Qt::ScrollBarAlwaysOff 389 | 390 | 391 | QAbstractItemView::InternalMove 392 | 393 | 394 | QAbstractItemView::SingleSelection 395 | 396 | 397 | QAbstractItemView::SelectRows 398 | 399 | 400 | Qt::ElideLeft 401 | 402 | 403 | QListView::Batched 404 | 405 | 406 | 407 | Bubble Sort 408 | 409 | 410 | AlignLeading|AlignVCenter 411 | 412 | 413 | 414 | 415 | Recursive Bubble Sort 416 | 417 | 418 | 419 | 420 | Cocktail Sort 421 | 422 | 423 | AlignLeading|AlignVCenter 424 | 425 | 426 | 427 | 428 | Gnome Sort 429 | 430 | 431 | 432 | 433 | Quick Sort 434 | 435 | 436 | 437 | 438 | Heap Sort 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | Qt::Vertical 447 | 448 | 449 | QSizePolicy::Fixed 450 | 451 | 452 | 453 | 20 454 | 40 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | Qt::Horizontal 465 | 466 | 467 | 468 | 40 469 | 20 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 0 479 | 0 480 | 481 | 482 | 483 | 484 | 176 485 | 30 486 | 487 | 488 | 489 | PointingHandCursor 490 | 491 | 492 | 493 | 494 | 495 | sort 496 | 497 | 498 | false 499 | 500 | 501 | 502 | 503 | 504 | 505 | Qt::Horizontal 506 | 507 | 508 | 509 | 40 510 | 20 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | Qt::Horizontal 526 | 527 | 528 | QSizePolicy::Fixed 529 | 530 | 531 | 532 | 20 533 | 20 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | --------------------------------------------------------------------------------