Skip to content

Commit

Permalink
Adicionada receita para Heapsort e PQsort
Browse files Browse the repository at this point in the history
Signed-off-by: Bruno Ribas <brunoribas@gmail.com>
  • Loading branch information
bcribas committed Apr 1, 2021
1 parent ddba875 commit 567db9b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ BINARY?=dummy\
systemqsort\
introsortquickmerge\
introsortquickmergelongjmp\
cppsort
cppsort\
pqsortsimple\
heapsort

ORDENADO=$(wildcard input/*ordenado)
ALEATORIO=$(wildcard input/*aleatorio)
Expand Down Expand Up @@ -73,6 +75,12 @@ introsortquickmerge: main.c introsortquickmerge.c separa.c insertionsort.c merge
introsortquickmergelongjmp: main.c introsortquickmergelongjmp.c separa.c insertionsort.c mergesort.c
gcc -D__$@__ $(CFLAGS) $^ -o $@ -lm

pqsortsimple: main.c pqsortsimple.c priority-queue.c
gcc -D__$@__ $(CFLAGS) $^ -o $@

heapsort: main.c heapsort.c priority-queue.c
gcc -D__$@__ $(CFLAGS) $^ -o $@

printorder:
@for T in 08 09 10 11 12 13 14 15 16 17 18 19 20;do\
printf " %s " $$T;\
Expand Down
8 changes: 8 additions & 0 deletions main.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@
#define __systemqsortonly__
#include "systemqsort.h"

#elif defined(__pqsortsimple__)
#define __pqsortonly__
#include "pqsortsimple.h"

#elif defined(__heapsort__)
#define __heapsortonly__
#include "heapsort.h"

#elif defined(__dummy__)
#warning "DUMMY SORT, it will not sort"
#define sort ;
Expand Down

0 comments on commit 567db9b

Please sign in to comment.