Skip to content

Commit 551a61c

Browse files
committed
reorganizing
1 parent f69c316 commit 551a61c

File tree

30 files changed

+67
-37
lines changed

30 files changed

+67
-37
lines changed

algorithms/graphs/APSP-floyd/makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/amatrix \
7-
../../../datastructures/lists ../../../datastructures/htables/single-value
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/single-value \
9+
../../../datastructures/htables/single-value/string-size-t
810
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
911
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1012
SRCS := $(wildcard *.c)

algorithms/graphs/APSP-johnson/johnson.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313

1414
#include "../../../datastructures/graphs/graph/graph.h"
15-
#include "../../../datastructures/pqueues/bpqueue.h"
15+
#include "../../../datastructures/heaps/bpqueues/bpqueue.h"
1616
#include "../../../lib/clib.h"
1717
#include <float.h>
1818

@@ -110,7 +110,7 @@ void reweightEdges(graph *G) {
110110

111111
//===================================================================
112112
// Copies the key (priority) of a node in the priority queue
113-
void *copyKey (void *key) {
113+
void *copyKey (void const *key) {
114114
double *copy = safeCalloc(1, sizeof(double));
115115
*copy = *(double *)key;
116116
return copy;
@@ -141,7 +141,7 @@ char *vertexToString(void const *key) {
141141
bpqueue *initPQ(graph *G, vertex *src) {
142142

143143
bpqueue *pq = bpqNew(nVertices(G), MIN, compareKeys, copyKey,
144-
free, vertexToString);
144+
free, vertexToString, NULL);
145145

146146
for (vertex *v = firstV(G); v; v = nextV(G)) {
147147
v->dDist = v == src ? 0 : DBL_MAX;

algorithms/graphs/APSP-johnson/makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE5
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/graph \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value \
8-
../../../datastructures/pqueues/ ../../../datastructures/htables/single-value
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value \
9+
../../../datastructures/heaps/bpqueues \
10+
../../../datastructures/htables/single-value \
11+
../../../datastructures/htables/single-value/string-size-t
912
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
1013
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1114
SRCS := $(wildcard *.c)

algorithms/graphs/APSP-matrix-mult/makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/amatrix \
7-
../../../datastructures/lists ../../../datastructures/htables/single-value
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/single-value \
9+
../../../datastructures/htables/single-value/string-size-t
810
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
911
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1012
SRCS := $(wildcard *.c)

algorithms/graphs/APSP-transitive-closure/makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33

44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99
6-
LIBDIRS = ../../../lib ../../../datastructures/graphs/amatrix \
7-
../../../datastructures/lists ../../../datastructures/htables/single-value
6+
LIBDIRS = ../../../lib \
7+
../../../datastructures/graphs/amatrix \
8+
../../../datastructures/lists \
9+
../../../datastructures/htables/single-value \
10+
../../../datastructures/htables/single-value/string-size-t
811
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
912
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1013
SRCS := $(wildcard *.c)

algorithms/graphs/ETP-Hierholzer/makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE3 -D EDGE_TYPE3
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/graph \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value
89
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
910
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1011
SRCS := $(wildcard *.c)

algorithms/graphs/ETP-fleury/makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE3 -D EDGE_TYPE3
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/graph \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value
89
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
910
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1011
SRCS := $(wildcard *.c)

algorithms/graphs/MCBM-dinitz/makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE5
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/network \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value \
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value \
89
../../../datastructures/queues
910
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
1011
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))

algorithms/graphs/MCBM-mcmf/makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE6
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/network \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value \
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value \
89
../../../datastructures/queues
910
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
1011
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))

algorithms/graphs/MST-kruskal/makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE2 -D EDGE_TYPE2
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/graph \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value \
8-
../../../datastructures/union-find ../../../datastructures/htables/single-value \
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value \
9+
../../../datastructures/union-find \
10+
../../../datastructures/htables/single-value/string-size-t \
11+
../../../datastructures/htables/single-value \
912
../../../datastructures/heaps/binheaps
1013
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
1114
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))

algorithms/graphs/MST-prim/makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE2
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/graph \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value \
8-
../../../datastructures/heaps/bpqueues ../../../datastructures/htables/single-value \
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value \
9+
../../../datastructures/heaps/bpqueues \
10+
../../../datastructures/htables/single-value \
11+
../../../datastructures/htables/single-value/string-size-t \
912
../../../datastructures/heaps/fibheaps
1013
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
1114
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))

algorithms/graphs/SSSP-DAG/makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE4
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/graph \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value
89
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
910
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1011
SRCS := $(wildcard *.c)

algorithms/graphs/SSSP-bellman-ford/makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE2
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/graph \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value
89
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
910
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1011
SRCS := $(wildcard *.c)

algorithms/graphs/SSSP-dijkstra/makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE2
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/graph \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value \
8-
../../../datastructures/heaps/bpqueues ../../../datastructures/htables/single-value \
9-
../../../datastructures/heaps/fibheaps
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value \
9+
../../../datastructures/heaps/bpqueues \
10+
../../../datastructures/htables/single-value \
11+
../../../datastructures/heaps/fibheaps \
12+
../../../datastructures/htables/single-value/string-size-t
1013
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
1114
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1215
SRCS := $(wildcard *.c)

algorithms/graphs/bfs/makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE2
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/graph \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value \
8-
../../../datastructures/queues/
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value \
9+
../../../datastructures/queues
910
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
1011
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1112
SRCS := $(wildcard *.c)

algorithms/graphs/dfs/makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE1 -D EDGE_TYPE1
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/graph \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value
89
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
910
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1011
SRCS := $(wildcard *.c)

algorithms/graphs/scc/makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99 -D VERTEX_TYPE3
66
LIBDIRS = ../../../lib ../../../datastructures/graphs/graph \
7-
../../../datastructures/lists ../../../datastructures/htables/multi-value
7+
../../../datastructures/lists \
8+
../../../datastructures/htables/multi-value
89
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
910
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1011
SRCS := $(wildcard *.c)

datastructures/graphs/amatrix/graph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#ifndef GRAPH_H_INCLUDED
2525
#define GRAPH_H_INCLUDED
2626

27-
#include "../../htables/single-value/sstmap.h"
27+
#include "../../htables/single-value/string-size-t/sstmap.h"
2828
#include "vertex.h"
2929

3030
// graph types

datastructures/graphs/amatrix/test/makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99
66
LIBDIRS = ../../../../lib .. ../../../lists \
7-
../../../htables/single-value
7+
../../../htables/single-value \
8+
../../../htables/single-value/string-size-t
89
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
910
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
1011
SRCS := $(wildcard *.c)

datastructures/heaps/bpqueues/bpqueue.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include <stdlib.h>
1818
#include <stdbool.h>
1919
#include <stdio.h>
20-
#include "../../htables/single-value/sstmap.h"
20+
#include "../../htables/single-value/string-size-t/sstMap.h"
2121

2222
// function pointer types
2323
typedef int (*bpqCompKey)(void const *a, void const *b);

datastructures/heaps/bpqueues/test/makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99
6-
LIBDIRS = ../../../../lib .. ../../../htables/single-value ../../../lists
6+
LIBDIRS = ../../../../lib .. ../../../htables/single-value \
7+
../../../lists ../../../htables/single-value/string-size-t
78
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
89
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
910
SRCS := $(wildcard *.c)

datastructures/htables/multi-value/sshtable.c renamed to datastructures/htables/multi-value/string-string/sshtable.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <ctype.h>
99
#include <string.h>
1010
#include "sshtable.h"
11-
#include "../../../lib/clib.h"
11+
#include "../../../../lib/clib.h"
1212

1313
//===================================================================
1414
// FNV-1a hash function

datastructures/htables/multi-value/sshtable.h renamed to datastructures/htables/multi-value/string-string/sshtable.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifndef SSHTABLE_H_INCLUDED
99
#define SSHTABLE_H_INCLUDED
1010

11-
#include "htable.h"
11+
#include "../htable.h"
1212

1313
typedef struct sshtable sshtable;
1414

datastructures/htables/single-value/test/makefile renamed to datastructures/htables/multi-value/string-string/test/makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99
6-
LIBDIRS = ../../../../lib .. ../../../lists
6+
LIBDIRS = ../../../../../lib .. ../../ ../../../../lists
77
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
88
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
99
SRCS := $(wildcard *.c)

datastructures/htables/single-value/sstMap.c renamed to datastructures/htables/single-value/string-size-t/sstMap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <ctype.h>
99
#include <string.h>
1010
#include "sstMap.h"
11-
#include "../../../lib/clib.h"
11+
#include "../../../../lib/clib.h"
1212

1313
//===================================================================
1414
// FNV-1a hash function

datastructures/htables/single-value/sstMap.h renamed to datastructures/htables/single-value/string-size-t/sstMap.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifndef SSTMAP_H_INCLUDED
99
#define SSTMAP_H_INCLUDED
1010

11-
#include "map.h"
11+
#include "../map.h"
1212

1313
typedef struct sstMap sstMap;
1414

datastructures/htables/multi-value/test/makefile renamed to datastructures/htables/single-value/string-size-t/test/makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
CC = gcc
55
CFLAGS = -O2 -Wall -pedantic -std=c99
6-
LIBDIRS = ../../../../lib .. ../../../lists
6+
LIBDIRS = ../../../../../lib .. ../.. ../../../../lists
77
LIBOBJS = $(foreach dir, $(LIBDIRS), $(wildcard $(dir)/*.c))
88
LIBOBJS := $(patsubst %.c, %.o, $(LIBOBJS))
99
SRCS := $(wildcard *.c)

datastructures/union-find/unionFind.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#include <stdlib.h>
1212
#include <stdbool.h>
13-
#include "../htables/single-value/sstmap.h"
13+
#include "../htables/single-value/string-size-t/sstMap.h"
1414

1515
typedef void (*ufFreeData)(void *data);
1616
typedef void *(*ufCpyData)(void const *data);

0 commit comments

Comments
 (0)