Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef RED_POKAZIVAC_H
- #define RED_POKAZIVAC_H
- #include <iostream>
- using namespace std;
- struct tPerson {
- string name, lname;
- bool sex;
- string dmy;
- int ai,bi,ci,di;
- };
- struct tRed {
- tPerson Person;
- tRed *next;
- };
- struct tPokRed {
- tRed *rear;
- tRed *front;
- };
- tPokRed PK;
- template <typename T>
- tPerson FrontQ (T *Red) {
- return Red->next->Person;
- }
- template <typename D, typename T>
- void EnQueueQ (D person, T *Red) {
- T *qRed = new T;
- qRed->next = NULL;
- qRed->Person = person;
- PK.rear = PK.rear->next = qRed;
- }
- template <typename T>
- void DeQueueQ (T *&Red) {
- T *qRed = Red;
- Red = PK.front = PK.front->next;
- delete qRed;
- }
- template <typename T>
- bool IsEmptyQ (T *Red) {
- return (PK.rear == PK.front);
- }
- template <typename T>
- void InitQ (T *Red) {
- PK.rear = PK.front = Red;
- }
- #endif // RED_POKAZIVAC_H
Advertisement
Add Comment
Please, Sign In to add comment