feat: add tree-finder

This commit is contained in:
Michael Mandl 2024-03-20 15:05:25 +01:00
parent 1ab711f81c
commit bdc720694f
Signed by: mandlm
GPG key ID: 4AA25D647AA54CC7
5 changed files with 123 additions and 6 deletions

View file

@ -5,6 +5,7 @@
#include "linear_finder.h"
#include "parallel_finder.h"
#include "timer.h"
#include "tree_finder.h"
#include "word_list_generator.h"
#include <sstream>
@ -26,6 +27,7 @@ MainWindow::~MainWindow() { delete ui; }
void MainWindow::setupAlgorithmSelector() {
search_algorithms_.appendRow(new QStandardItem("Linear search"));
search_algorithms_.appendRow(new QStandardItem("Parallel search"));
search_algorithms_.appendRow(new QStandardItem("Tree search"));
}
void MainWindow::generateWordList() {
@ -68,6 +70,8 @@ std::unique_ptr<Finder> MainWindow::createSelectedFinder() const {
case 1:
return std::make_unique<ParallelFinder>(
word_list_, std::thread::hardware_concurrency());
case 2:
return std::make_unique<TreeFinder>(word_list_);
}
}