Question: We have a contains() function in LazyList for concurrent data structures which checks whether a particular item is contained in the linked list and returns
We have a contains() function in LazyList for concurrent data structures which checks whether a particular item is contained in the linked list and returns false if tge matching node is marked as deleted. The code for the same is given below:
bool LazyList:: contains (T * item) {
Node * curr = head;
while (curr -> key < item ->key)
curr = curr ->next;
return current->key == item-> key && !curr->marked
Write a contains() function for Concurrent Lists with Fine Grained synchronization.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
