This commit is contained in:
2022-10-29 13:41:12 +02:00
parent 165db0f093
commit bdb9bd3625
130 changed files with 17841 additions and 1527 deletions

View File

@ -47,19 +47,10 @@ class LinkedList {
class Iterator {
ItemType* _node;
ItemType* _nextNode = nullptr;
public:
Iterator(ItemType* current = nullptr) : _node(current) {
if (_node != nullptr) {
_nextNode = current->next;
}
}
Iterator(ItemType* current = nullptr) : _node(current) {}
Iterator(const Iterator& i) : _node(i._node) {}
Iterator& operator ++() {
_node = _nextNode;
_nextNode = _node != nullptr ? _node->next : nullptr;
return *this;
}
Iterator& operator ++() { _node = _node->next; return *this; }
bool operator != (const Iterator& i) const { return _node != i._node; }
const T& operator * () const { return _node->value(); }
const T* operator -> () const { return &_node->value(); }
@ -180,23 +171,4 @@ class LinkedList {
}
};
class StringArray : public LinkedList<String> {
public:
StringArray() : LinkedList(nullptr) {}
bool containsIgnoreCase(const String& str){
for (const auto& s : *this) {
if (str.equalsIgnoreCase(s)) {
return true;
}
}
return false;
}
};
#endif /* STRINGARRAY_H_ */