From 3a0f9e67a77e4061456461dd3a145c476dccfb19 Mon Sep 17 00:00:00 2001 From: Jeonghyun Min <20122791@tafe.wa.edu.au> Date: Thu, 7 Nov 2024 09:14:06 +0800 Subject: [PATCH] Update: modifying sys.path to include sorts folder --- sorts/stopwatch_sort.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sorts/stopwatch_sort.py b/sorts/stopwatch_sort.py index 77ccfb59a..1527a8b52 100644 --- a/sorts/stopwatch_sort.py +++ b/sorts/stopwatch_sort.py @@ -13,9 +13,14 @@ so it can be used to see how long each sorting algorithm takes to complete the sorting process. """ +import os import random +import sys import time +# Modify sys.path to include the 'sorts' directory by adding the parent directory +sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) + from sorts.binary_insertion_sort import binary_insertion_sort from sorts.bubble_sort import bubble_sort_iterative from sorts.bucket_sort import bucket_sort