Read the following code. Fill in each blank. struct Node Type; typedef Node Type
ID: 3812284 • Letter: R
Question
Read the following code. Fill in each blank. struct Node Type; typedef Node Type NodePtr. structNodeType {ItemType info; NodePtr next;} class StackType {public://Prototypes go here private: NodePtr stack;}; StackType::StackType()//Pre: none//Post: stock has been created. {_____;} viodStackType::Push(ItemType item)//Pre: stack is not full//Post; item is on the stack {NodePtr itemPtr; itemPtr = _____;//2 _____ = item;//3 _____ = stack;//4 stack = itemPtr;} classQueType {public;//protypes go here private: NodePtr front; NodePtr rear;} BooleanQueType;;IsEmpty ()//Pre: queue has been created//Post;; return true if queue is//empty;false, otherwise. {return _____;} Void Quetype::Deque (ItemType& item)//Pre: queue is not empty//Post; item with the longest time//on the queue is removed. {NodePtr tempPtr, tempPtr = _____;//6 item = _____;//7 front = _____;//8 if(_____)//9 rear = NULL; delete _____;//10} #1 top = -1 new Node Type front front rightarrow next front == NULLExplanation / Answer
#3. itemPtr->info
#4. itemPtr->next
#5. front==rear
#6. front
#7. item = front
#8. front = front->next
#9. front == NULL
#10. tempPtr
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.