Init commit skeleton project
This commit is contained in:
commit
555669fd5c
5 changed files with 29 additions and 0 deletions
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
ListRotations
|
||||||
|
src/*.o
|
16
Makefile
Normal file
16
Makefile
Normal file
|
@ -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
|
1
link
Normal file
1
link
Normal file
|
@ -0,0 +1 @@
|
||||||
|
https://programmingpraxis.com/2020/03/27/list-rotation/
|
7
problem
Normal file
7
problem
Normal file
|
@ -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.
|
3
src/main.c
Normal file
3
src/main.c
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
int main(int argc, char **argv) {
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in a new issue