From 4f27fe893c0e5b85122a228dd66f79bc8fa87088 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Mon, 2 May 2022 22:01:24 +0300 Subject: Fixed OrderedList location --- List/OrderedList.cpp | 12 ------------ List/OrderedList.h | 16 ---------------- 2 files changed, 28 deletions(-) delete mode 100644 List/OrderedList.cpp delete mode 100644 List/OrderedList.h (limited to 'List') diff --git a/List/OrderedList.cpp b/List/OrderedList.cpp deleted file mode 100644 index f3a7450..0000000 --- a/List/OrderedList.cpp +++ /dev/null @@ -1,12 +0,0 @@ -#include "OrderedList.h" - -template -bool OrderedList::insert(const T& element) { - if (List::length == List::count) List::resize(); - - unsigned insertionInd = 0; - while (List::elements[insertionInd].compare(element) < 0 && insertionInd < List::count) - insertionInd++; - - return List::insertAt(element, insertionInd); -} diff --git a/List/OrderedList.h b/List/OrderedList.h deleted file mode 100644 index 22f05df..0000000 --- a/List/OrderedList.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef HEADER_ORDEREDLIST -#define HEADER_ORDEREDLIST - -#include "List.h" - -template -class OrderedList : public List { -public: - void add(const T& element) = delete; - bool insertAt(const T& element, unsigned index) = delete; - - bool insert(const T& element); - // unsigned findIndex(const T& element) const; TODO: binary search -}; - -#endif -- cgit v1.3.1-26-gb76a