-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·56 lines (51 loc) · 1.34 KB
/
run.sh
File metadata and controls
executable file
·56 lines (51 loc) · 1.34 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
#!/bin/bash
sudo apt-get install -y freeglut3-dev libglfw3-dev libglfw3 > /dev/null 2>&1
# Prompt the user for input
echo "Enter a number between 1 and 6 (or 0 to Exit):"
echo "1) Menu driven Graph"
echo "2) Menu driven Binary Tree for Int"
echo "3) Menu driven Binary Tree for String"
echo "4) Menu driven AVL Tree for Int"
echo "5) Menu driven AVL Tree for String"
echo "6) Menu driven Red-Black Tree"
echo "0) Exit"
read num
# Switch-case statement
case $num in
1)
echo "You entered 1."
gcc graph/main.c -lGL -lGLU -lglut -lm -g
;;
2)
echo "You entered 2."
gcc binarySearchTreeForInt/main.c -lGL -lGLU -lglut -lm -g
;;
3)
echo "You entered 3."
gcc binarySearchTreeForString/main.c -lGL -lGLU -lglut -lm -g
;;
4)
echo "You entered 4."
gcc AVLtreeForInt/main.c -lGL -lGLU -lglut -lm -g
;;
5)
echo "You entered 5."
gcc AVLtreeForString/main.c -lGL -lGLU -lglut -lm -g
;;
6)
echo "You entered 6."
gcc RedBlackTreeForString/main.c -lGL -lGLU -lglut -lm -g
;;
0)
echo "Exiting..."
exit
;;
*)
echo "Invalid input! Please enter a number between 0 and 6."
exit 1
;;
esac
# Execute the compiled program
./a.out
# Clean up the compiled file
rm a.out