Can any one tell me what is the meaning of lazy deletion in an array?
Can any one tell me what is the meaning of lazy deletion in an array?
please set free our POWs
"lazy deletion" usually means you just mark somthing as deleted, instead of actually deleting it.
gg
Thanx for answering
this mark will be a flag?
please set free our POWs
i've searched in a browser about this but couldn't find anything helpful i have a midterm after one day and this was a question from last course (to write a code for deletion and insertion using flags (lazy deletion) in an array of a specefied size)i know i've got to have a node structure contains an integer data and a bool flag but couldn't know the method.
Code:#include <stdio.h> #include <malloc.h> struct node{ int data; bool deleted; node(int x){data=x; deleted=Fales;} }; class queue{ private: node element[100]; public: //???????? };
please set free our POWs
You should read your text book.
queue ADT
gg
Thanx
i know how to do a class queue with its functions but what i wanted to do is to use the lazy deletion method that like if i had an array of 6 elements i want to delete a certin element given from the user not its first element i know how to do it by loop and shifting but don't know how to use the flags and the lazy method.
please set free our POWs
Since you are using a static array of nodes, there is no use for lazy deletion since there is nothing to delete in the first place. If your queue were implemented using a linked list, then you could use lazy deletion.
gg