Добавил:
Studfiles2
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз:
Предмет:
Файл:Шпоры по МПиПА / Структуры данных / Список / C / Исходник / list
.h#ifndef __list_h
#define __list_h
#include <iostream.h>
class List {
private:
struct node { //Default data structure
int id; //Indificator
char a; //Field1
char b; //Field2
char c; //Field3
char d; //Field4
node* prev; //Link to prev node
node* next; //Link to next node
};
node* start; //Link to start node
node* curr; //Mark
int cnt; //Count of list
int id; //Group ID
void lerror (char *err); //If error occured
public:
List (); //Default Constructor
~List (); //Destructor
bool empty(); //Is list empty?
bool rewind (int topos); //Rewind on <> positions
bool rewindto (int topos); //Rewind to <> position
int count(); //Get list nodes count
void add(int pos, char a, char b, char c, char d); //Add new node to <> position
void add(char a, char b, char c, char d); //Add new node after active node
bool get(char &a,char &b,char &c,char &d); //Get values of active node
void update (char a, char b, char c, char d); //Update active node
void update (int pos, char a, char b, char c, char d); //Update node in <> position
void print(int from); //Print from <> position
void print(); //Print list nosed
void del(); //Delete active node
void del(int pos); //Delete node in <> position
void exchange(int pos); //Exchange <n> and <n+1> nodes
};
#endif