From 26c776c3f47d488dd186e1fbfb6cd79e65ab57f6 Mon Sep 17 00:00:00 2001 From: yigencong Date: Sat, 24 Feb 2024 15:20:50 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=95=B0=E7=BB=84?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sort/test.mjs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 sort/test.mjs diff --git a/sort/test.mjs b/sort/test.mjs new file mode 100644 index 0000000..9b792d2 --- /dev/null +++ b/sort/test.mjs @@ -0,0 +1,15 @@ +import { generateRandomArray, measureTime, isSort } from "../util/index.mjs"; +import { shellSort } from "./shell-sort.mjs"; +import {insertionSort } from "./insertion-sort.mjs" +import { bubbleSort } from "./bubble-sort.mjs" + +let arr = generateRandomArray(10000) +let arr2 = arr.slice() +let arr3 = arr.slice() + +measureTime(bubbleSort,arr) +measureTime(insertionSort,arr2) +measureTime(shellSort,arr3) +console.log(isSort(arr)); +console.log(isSort(arr2)); +console.log(isSort(arr3)); \ No newline at end of file