home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 3
/
CDASC03.ISO
/
sorties
/
4140
/
whois_.exe
/
SLLIST.HPP
< prev
next >
Wrap
Text File
|
1991-08-20
|
2KB
|
62 lines
/****************************************************************
File Name: sllist.hpp
Author: Andrew Frantz
Purpose: singly linked list(queue) definition
Date: 2/8/91
Environ: BORLAND C++ v2.0
Keywrd(s): CPP SINGLY LINKED LIST
Revision Log:
1. 3/22/91; Changed data_field1 to rec_num in struct node
2. 3/23/91; Added void* some_more_data to struct node
3. 3/23/91; Added add_queue() function ;
4. 3/25/91; Changed node *next to void *next in node struct
****************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
// ==========================================================
struct node
{
int rec_num;
char file_name[80];
int edge;
void *next;
};
// ==========================================================
class sllist
{
public:
//data
protected:
//data
private:
//data
node *head;
public:
//functions
sllist() { head = NULL; } // constructor
~sllist() { del_all(); } // detructor of list
node* get_head() { return head; }
void put_head(node* input) {head=input;}
void add_in_p_order(int c); // priority add item to list
node* add_queue(int c); // queue add FIFO
node* add_queue(char *fname);
void del_one(int c); // delete one item in list
void print_list();
void print_stack();
int pop_stack(int *redg);
void push_stack(int rec_num, int edge);
int check_stack_for_cycle(); //for graph
void del_all(); // delete all items in list
protected:
//functions
private:
//functions
};
// ==========================================================
// =================== End of Listing =======================