ARTICLE AD BOX
I'm trying to make a doubly linked hash table, sort of. At least, within each bucket it is doubly linked.
My issue is when I am trying to assign the next/previous pointer to of the top of the bucket. The code that is causing the issue is below.
At first, I thought it was because I was trying to manipulate a vector directly, so I made a temp pointer, but the same issue arose. Specifically, when I was trying to manipulate the next or previous pointer of the node at buckets[h].
I get the feeling that the issue is quite basic, but I can not figure out what it is.
Node* new_node = new Node; new_node->data = x; new_node->next = buckets[h]; new_node->prev = NULL; buckets[h]->prev = new_node; // this is the problem line buckets[h] = new_node;