diff --git a/data_structures/queue/include.h b/data_structures/queue/include.h new file mode 100644 index 00000000..e4820eb5 --- /dev/null +++ b/data_structures/queue/include.h @@ -0,0 +1,28 @@ +////////////////////////////////////////////////////////////////////////////////////// +/// INCLUDES + +#include +#include +//////////////////////////////////////////////////////////////////////////////// +// DATA STRUCTURES +/** + * Defining the structure of the node which contains 'data' (type : integer), + * two pointers 'next' and 'pre' (type : struct node). + */ + +struct node +{ + int data; + struct node *next; + struct node *pre; +} * head, *tail, *tmp; + +//////////////////////////////////////////////////////////////////////////////// +// FORWARD DECLARATIONS + +void create(); +void enque(int x); +int deque(); +int peek(); +int size(); +int isEmpty(); diff --git a/data_structures/queue.c b/data_structures/queue/queue.c similarity index 64% rename from data_structures/queue.c rename to data_structures/queue/queue.c index 35020037..2b936be0 100644 --- a/data_structures/queue.c +++ b/data_structures/queue/queue.c @@ -1,36 +1,11 @@ //////////////////////////////////////////////////////////////////////////////// // INCLUDES -#include -#include - -//////////////////////////////////////////////////////////////////////////////// -// MACROS: CONSTANTS - -//////////////////////////////////////////////////////////////////////////////// -// DATA STRUCTURES -/** - * Defining the structure of the node which contains 'data' (type : integer), two pointers 'next' and 'pre' (type : struct node). - */ -struct node -{ - int data; - struct node *next; - struct node *pre; -} * head, *tail, *tmp; +#include "include.h"; //////////////////////////////////////////////////////////////////////////////// // GLOBAL VARIABLES int count; -//////////////////////////////////////////////////////////////////////////////// -// FORWARD DECLARATIONS -void create(); -void enque(int x); -int deque(); -int peek(); -int size(); -int isEmpty(); - //////////////////////////////////////////////////////////////////////////////// // MAIN ENTRY POINT