tfpf / circular-doubly-linked-list-josephus-problem

A circular doubly-linked list implementation. Used to solve the Josephus problem.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Circular Doubly-Linked List

CDLListNode.c and CDLList.c provide an implementation of a circular doubly-linked list of integers. These are used to solve the Josephus problem.

Josephus Problem

There are 100 people standing in a circle. Every third person is eliminated. (In other words, the people at positions 3, 6, 9, and so on are eliminated.) This continues till there's only one person left. Who will win this game? Run

make

and then

./josephus 100 3

to find out.

Note

I do not condone violence.

About

A circular doubly-linked list implementation. Used to solve the Josephus problem.


Languages

Language:C 96.6%Language:Makefile 3.4%