commit 555669fd5c845d907aa3d458822f09304984ea0f Author: Stephen Seo Date: Sat Jun 6 19:46:49 2020 +0900 Init commit skeleton project diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b05ece9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +ListRotations +src/*.o diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..0820117 --- /dev/null +++ b/Makefile @@ -0,0 +1,16 @@ +CC = gcc +COMMON_FLAGS = -Wall -Wextra -Wpedantic +ifdef DEBUG + CFLAGS = $(COMMON_FLAGS) -g -O0 +else + CFLAGS = $(COMMON_FLAGS) -O3 -DNDEBUG +endif + +all: ListRotations + +ListRotations: src/main.o + $(CC) $(CFLAGS) $(LINKER_FLAGS) -o ListRotations $^ + +clean: + rm -f ListRotations + rm -f src/*.o diff --git a/link b/link new file mode 100644 index 0000000..f4531c3 --- /dev/null +++ b/link @@ -0,0 +1 @@ +https://programmingpraxis.com/2020/03/27/list-rotation/ diff --git a/problem b/problem new file mode 100644 index 0000000..93b11d9 --- /dev/null +++ b/problem @@ -0,0 +1,7 @@ +Given a length-n list like (a b c d e), the rotations of the list are the n +lists (a b c d e), (b c d e a), (c d e a b), (d e a b c), and (e a b c d), in +any order. + +Your task is to write a program that takes a list and returns its rotations. +When you are finished, you are welcome to read or run a suggested solution, or +to post your own solution or discuss the exercise in the comments below. diff --git a/src/main.c b/src/main.c new file mode 100644 index 0000000..11b7fad --- /dev/null +++ b/src/main.c @@ -0,0 +1,3 @@ +int main(int argc, char **argv) { + return 0; +}