typo fix and trying list instead of vector
This commit is contained in:
parent
61a710f938
commit
1bfe6e806a
1 changed files with 4 additions and 4 deletions
8
Map.hpp
8
Map.hpp
|
@ -5,10 +5,10 @@
|
|||
#include <cstddef>
|
||||
#include <initializer_list>
|
||||
#include <iterator>
|
||||
#include <list>
|
||||
#include <optional>
|
||||
#include <stdexcept>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
// everything is super interconnected so some forward declarations are needed at
|
||||
// various points
|
||||
|
@ -36,7 +36,7 @@ template <typename Key_T, typename Mapped_T> struct BookKeeping {
|
|||
friend class Map<Key_T, Mapped_T>;
|
||||
Map<Key_T, Mapped_T> &container;
|
||||
ValueType value;
|
||||
typename std::vector<Self>::iterator self;
|
||||
typename std::list<Self>::iterator self;
|
||||
Color color;
|
||||
// nullptr indicates empty
|
||||
Self *parent;
|
||||
|
@ -258,7 +258,7 @@ private:
|
|||
Node *root;
|
||||
Node *min;
|
||||
Node *max;
|
||||
std::vector<Node> nodes;
|
||||
std::list<Node> nodes;
|
||||
|
||||
public:
|
||||
Map() : root{nullptr}, min{nullptr}, max{nullptr}, nodes{} {}
|
||||
|
@ -430,7 +430,7 @@ private:
|
|||
Direction dir;
|
||||
while (current != nullptr && current->value.first != key) {
|
||||
parent = current;
|
||||
if (current->value.fist < key) {
|
||||
if (current->value.first < key) {
|
||||
dir = Direction::Left;
|
||||
current = current->left;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue