47 lines
1.4 KiB
C
47 lines
1.4 KiB
C
|
//////////////////////////////////////////////////////////////////////////////
|
||
|
// Praktikum Informatik 1
|
||
|
// Versuch 4.2: Dynamische Datenstrukturen
|
||
|
//
|
||
|
// Datei: List.h
|
||
|
// Inhalt: Liste mit Methoden
|
||
|
//////////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
#ifndef LIST_H_
|
||
|
#define LIST_H_
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////////////
|
||
|
///////////////////////////////// INCLUDES ///////////////////////////////////
|
||
|
//////////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
#include <iostream>
|
||
|
#include <string>
|
||
|
using namespace std;
|
||
|
#include "Student.h"
|
||
|
|
||
|
//////////////////////////////////////////////////////////////////////////////
|
||
|
///////////////////////// STRUCT DECLARATION /////////////////////////////////
|
||
|
//////////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
struct List
|
||
|
{
|
||
|
|
||
|
List();
|
||
|
void enqueuehead(const Student& stud); // vorne anhängen
|
||
|
void enqueuetail(const Student& stud); // hinten anhängen
|
||
|
bool dequeue(Student& stud); // hinten abhängen, wird nicht benötigt
|
||
|
void ausgabevorwaerts(); // von vorne nach hinten ausgeben
|
||
|
void ausgaberueckwaerts(); // von hinten nach vorne ausgeben
|
||
|
bool remove(int matNr);
|
||
|
|
||
|
struct ListElem{
|
||
|
Student data;
|
||
|
ListElem* prev;
|
||
|
ListElem* next;
|
||
|
};
|
||
|
|
||
|
ListElem* head;
|
||
|
ListElem* tail;
|
||
|
};
|
||
|
|
||
|
#endif /*LIST_H_*/
|