aboutsummaryrefslogtreecommitdiff
path: root/report
diff options
context:
space:
mode:
authorNavid Samanghoon <nsama24@student.sdu.dk>2025-10-24 14:21:01 +0200
committermithe24 <mithe24@student.sdu.dk>2025-10-29 13:49:57 +0100
commit18a34de5402282a14bcf143e36f21d9814f9f19d (patch)
treee21d0b786d1839d03d5dbf626da197360cd0be15 /report
parente7fac2e4ef4545b4355f15f3aca0dd75f2a7a6b9 (diff)
downloadsorter-18a34de5402282a14bcf143e36f21d9814f9f19d.tar.gz
sorter-18a34de5402282a14bcf143e36f21d9814f9f19d.zip
Small modifications
Diffstat (limited to 'report')
-rw-r--r--report/report.tex18
1 files changed, 10 insertions, 8 deletions
diff --git a/report/report.tex b/report/report.tex
index e2fa3ed..6c152eb 100644
--- a/report/report.tex
+++ b/report/report.tex
@@ -48,10 +48,14 @@ will be implemented and compared against each other. Quick-sort is expected to e
while insertion-sort is more suitable for small or nearly sorted cases.
Several test
instances consisting of uniformly random coordinates will be created with the goal of comparing the implementations
-actual runtime to their theoretical runtimes. These datasets will be ranging from 10,000 to 5,000,000 elements, including edge
-cases with duplicates or nearly sorted lists.
+actual runtime to their theoretical runtimes and evaluate each implementation.
\section{Design}
+
+\subsection{How are the input file and output formatted?}
+
+
+\subsection{Program Flow}
The program is structured into four main phases: reading input, parsing data, sorting, and generating output. Each phase is
designed to handle a specific task, which creates modulariy and clarity. Whitin each phase a set of functions manage the corresponding
operations, allowing the programmer to focus on one task at a time. This design also greatly supports debugging
@@ -65,10 +69,8 @@ a short summary of the program.
\label{fig:flowchart}
\end{figure}
-\textbf{Reading Input:} The input file is given as a command line argument. Each coordinate consists of two values, the first
-coordinate x followed by a tab character, and the second coordinate y followed by a newline character. The first step of the program
-is to find this file, calculate the size of it using a function called \textit{getFileSize}, allocating memory, and saving the
-data.
+\textbf{Reading Input:} The first step of the program is to find the input file, use an open syscall, calculate the size of the file using a function
+called \textit{getFileSize}, allocating memory, and saving the coordinates.
\textbf{Parsing the data:} Next, the received file is to be parsed, meaning that only useful data will be extracted. This process omits
the tabs, and newlines, which in turn significantly simplifies iteration through the data, by ensuring that only 8-byte coordinates are left.
@@ -83,9 +85,9 @@ is easily achievable because of the array of pointers. The chosen algorithm can
a default algorithm will be run. This design where an algorithm can be passed to the sorting function, allows the programmed to be
extended with new algorithms if needed.
-\textbf{Generating output:} An important and necessary side effect of the \textit{make\_array\_from\_file} is converting ASCII characters
+\textbf{Generating output:} A side effect of the \textit{make\_array\_from\_file} is converting ASCII characters
to 8-byte integers. This allows the sorting algorithm to make numeric comparisons on the data. But this also means that the data should
-be converted back to ASCII, before any output can be printed.
+be converted back to ASCII, before printing the output.
\subsection{Why an array of pointers?}
In order to be a litte more general, and make our program easily expandable to