Marking a node as deleted

I have a remove function on a tree but I'm trying to use lazy deletion to get rid of it, how would I go about marking nodes as deleted so that when I'm traversing through the tree to print it out, it doesn't count the nodes that are marked "Deleted"?
Add a bool deleted; variable?
Yeah, I had a brain fart while I was working on it fixed up the tree but now I'm confused on what to do here. I'm supposed to make a struct of data members string and set of strings, so that I can pass the object containing the string and vector into the tree as a node.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include "LazyAvlTree.h"
using namespace std;

struct SequenceMap:public LazyAvlTree
{

string recognition;
vector<string>acronym;

SequenceMap(string &x, vector<string> &y) : recognition (x), acronym(y)
{
};
void MergeSequence(SequenceMap &x, SequenceMap &y)
{
   for(int i=0; i<y.acronym.size(); i++)
    { x.acronym.push_back(y.acronym[i]);
   }
}; 

bool operator <(SequenceMap &a)
{
     this->recognition < a.recognition;
};
};
int main()
{
vector<string>plop;
plop.push_back("test");
string l ="test";

LazyAvlTree<SequenceMap> t;
t.insert(SequenceMap(l, plop));
t.printTree( );
return 0;


}


this is what I have so far, it all seems wrong to me but errors occurred after I used functions from the LazyAvlTree class. Any help/ideas would be greatly appreciated.
Last edited on
Topic archived. No new replies allowed.