-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlgorithm.h
More file actions
56 lines (39 loc) · 1.28 KB
/
Algorithm.h
File metadata and controls
56 lines (39 loc) · 1.28 KB
1
2
3
4
5
6
7
8
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef ALGORITHM_H
#define ALGORITHM_H
#include <vector>
#include <iostream>
using namespace std;
template<class T>
class Algorithm {
public:
T* tab;
T* tab1;
T* tab2;
T* tab3;
int size;
// Konstruktor domyślny
Algorithm();
// Metoda do inicjalizacji
void initialize(const vector<T>& vector);
//Dekonstruktor
~Algorithm();
// Metoda do wyświetlania tablicy
void displayArray(T*& tab);
// Metoda zapisująca tablice do pliku
void saveToFile(const string& filename);
// Metoda sprawdzająca czy tablica jest posortowana
bool isTableSorted(T*& tab);
// Metoda do zapisu wyniku w pliku
void saveResult(double result, const string& filename);
// Metoda sortująca algorytmem przez wstawianie
void insertionSort(T*& tab, const string& filename);
// Metoda sortująca algorytmem przez wstawianie binarnie
void insertionSortBin(T*& tab, const string& filename);
//Metoda służąca do przywracania funkcji kopca
void heapify(T *&tab, int n, int i);
//Metoda sortująca algorytmem przez kopcowanie
void heapSort(T*& tab, const string& filename);
// Metoda sortująca algorytmem szybkim
void quickSort(T*& tab, int left, int right, const string& filename);
};
#endif // ALGORITHM_H