-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetLL.h
41 lines (35 loc) · 1 KB
/
SetLL.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//
// Created by tuli on 07/11/2020.
//
#ifndef HW1_SETLL_H
#define HW1_SETLL_H
#include "Set.h"
#include "LLNode.h"
class SetLL { //this is a linked list of sets with basic functions
public:
SetLL():
head(NULL), curr(NULL), size(0)
{}
void append(Set* set);
int gotoNext() { if ( curr->getNext() ) { curr = curr->getNext(); return 1; } return 0;}
int hasNext() { if ( curr->getNext() ) { return 1; } return 0;}
void gotoPrior();
void gotoBeginning() { curr = head; }
void gotoEnd() { while ( hasNext() ) gotoNext(); }
void Destroy();
void Print();
bool isEmpty() {if (head) { return false;} return true; }
LLNode* getCurr(){ return curr;}
void Replace(Set*& new_set);
LLNode* getHead() { return head; }
int del (LLNode* del);
LLNode* find (string name);
int getSize() const {return size;}
void append(Set *new_set, bool flg);
private:
LLNode* head;
LLNode* curr;
int size;
LLNode *find(int *elms);
};
#endif //HW1_SETLL_H