-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyPrinter.c
More file actions
38 lines (35 loc) · 753 Bytes
/
Copy pathmyPrinter.c
File metadata and controls
38 lines (35 loc) · 753 Bytes
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
//
// Created by ali raz on 6/3/20.
//
#include <stdio.h>
#include "array.h"
//print array prints the array to the stdin
void printArray(int arraySize, int arr[])
{
for (size_t i = 0; i < arraySize; i++)
{
printf("%d\t", arr[i]);
}
}
void newline(size_t x){
for (size_t i = 0; i < x; ++i) {
puts("");
}
}
void printArrow(unsigned int n){
newline(1);
for (unsigned int i = 0; i < n; ++i)
printf("|\t");
newline(1);
for (unsigned int i = 0; i < n; ++i)
printf("V\t");
newline(1);
}
void printSortFunction(int *arr,int n, void (function)(int *,int)){
randomiseArray(n,arr);
printArray(n,arr);
printArrow(n);
function(arr,n);
printArray(n,arr);
newline(2);
}