Website Summary Files Commits Branches @commit @diff @stats
path: root / Seminar06 / DLLSkeleton.cpp
diff options
context:
space:
mode:
Commit0ada48f859ab59acdbd67e67e887026cacc29e33 (patch)
Author
 Stoycho Kyosev <stoycho.kk@gmail.com>
2022-11-09 22:56:24 +0200
Committer
 Stoycho Kyosev <stoycho.kk@gmail.com>
2022-11-09 22:56:24 +0200
Files4b4edeee0fc768ddf48073804c4a0f8719e580ed /Seminar06/DLLSkeleton.cpp
Data-structures-and-algorithms-0ada48f859ab59acdbd67e67e887026cacc29e33.tar
Data-structures-and-algorithms-0ada48f859ab59acdbd67e67e887026cacc29e33.tar.gz
Data-structures-and-algorithms-0ada48f859ab59acdbd67e67e887026cacc29e33.zip
Parent16a916c1fc7ecf89bfbf910445740fb4596aae8f (diff)
add Seminar06
1 files changed, 70 insertions, 0 deletions
-rw-r--r--Seminar06/DLLSkeleton.cpp70
diff --git a/Seminar06/DLLSkeleton.cpp b/Seminar06/DLLSkeleton.cpp
new file mode 100644
index 0000000..77811b8
--- /dev/null
+++ b/Seminar06/DLLSkeleton.cpp
@@ -0,0 +1,70 @@
+#ifndef DOUBLY_LINKED_LIST_IMPL_
+#define DOUBLY_LINKED_LIST_IMPL_
+
+#include<exception>
+
+template<class T>
+class DoublyLinkedList {
+private:
+ struct DLListNode {};
+
+ using Node = DLListNode;
+
+ Node* head;
+ Node* tail;
+
+ void copy(const DoublyLinkedList<T>& other);
+ void free();
+
+ class Iterator {
+ private:
+ Node* current;
+ Iterator(Node* c) {}
+
+ public:
+ Iterator& operator++() {}
+
+ Iterator operator++(int) {}
+
+ Iterator& operator--() {}
+
+ Iterator operator--(int) {}
+
+ const T& operator*() {}
+
+ bool operator==(const Iterator& other) const {}
+
+ bool operator!=(const Iterator& other) const {}
+
+ friend class DoublyLinkedList<T>;
+ };
+
+public:
+ DoublyLinkedList();
+
+ DoublyLinkedList(const DoublyLinkedList<T>&);
+ DoublyLinkedList& operator=(const DoublyLinkedList<T>&);
+
+ DoublyLinkedList(DoublyLinkedList<T>&&);
+ DoublyLinkedList& operator=(DoublyLinkedList<T>&&);
+
+ void pushBack(const T&);
+ void popBack();
+
+ void pushFront(const T&);
+ void popFront();
+
+ bool empty() const;
+
+ const T& back() const;
+ const T& front() const;
+
+ Iterator begin();
+ Iterator end();
+
+ void insert(Iterator at, const T& elem);
+
+ ~DoublyLinkedList();
+};
+
+#endif \ No newline at end of file