mirror of
https://github.moeyy.xyz/https://github.com/TheAlgorithms/C.git
synced 2023-10-11 15:56:24 +08:00
feat: Moving queue file to it's directory and creating include file for it (#874)
* Putting queue in correct dir and creating include file for it * Update data_structures/queue/include.h missing one function, added Co-authored-by: David Leal <halfpacho@gmail.com> Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
parent
3cfdbb040d
commit
9bbec45d13
28
data_structures/queue/include.h
Normal file
28
data_structures/queue/include.h
Normal file
@ -0,0 +1,28 @@
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
/// INCLUDES
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// 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();
|
@ -1,36 +1,11 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// INCLUDES
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
|
Loading…
Reference in New Issue
Block a user