Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
592 B
1
Indexable
Never
#ifndef SORTEDLINKEDLIST_H
#define SORTEDLINKEDLIST_H

#include "ItemType.h"
#include "ListNode.h"

using namespace std;

class SortedLinkedList {
private:
    ListNode* head;
    ListNode* currentPos;
    int lengthOfList;
public:
    SortedLinkedList();
    ~SortedLinkedList();
    int length() const;
    void insertItem(ItemType item);
    void deleteItem(ItemType item);
    int searchItem(ItemType item);
    ItemType getNextItem();
    void resetList();
    void mergeList(SortedLinkedList list);
    void deleteAlternateNodes();
    void commonList(SortedLinkedList list);
};

#endif