Services
Discover
Homeschooling
Ask a Question
Log in
Sign up
Filters
Done
Question type:
Essay
Multiple Choice
Short Answer
True False
Matching
Topic
Computing
Study Set
Absolute C++
Quiz 17: Linked Data Structures
Path 4
Access For Free
Share
All types
Filters
Study Flashcards
Practice Exam
Learn
Question 21
Essay
Here is a diagram of a three node linked list with a head pointer and a node to be inserted.Show all steps necessary to delete the second node,pointed to by discard_me.You may assume the necessary search for the node to be deleted is done and the pointer discard_me is already positioned. You are to make clear the sequence of steps by either numbering the steps,or by making several copies of this drawing,with one change per drawing,numbered to show the sequence. You may assume that a search routine taking a head pointer and data arguments has been defined for you. Give code and the drawing to make clear what you are doing. NodePtr discard_me; NodePtr temp_ptr;
Question 22
Short Answer
Given the type definitions: const int STRING_SIZE = 20; struct ListNode { char item[STRING_SIZE]; int count; ListNode *link; }; ListNode *head = new ListNode; Give a typedef statement that hides the pointer operator *.Call the new type identifier NodePtr.
Question 23
Essay
A linked list is normally specified by giving a pointer pointing to the first node of a list.An empty list has no nodes at all.What is the value of a head pointer for an empty list?
Question 24
Essay
Here is a diagram of a three node linked list with a head pointer and a node to be inserted.Show all steps necessary to insert the node pointed to by temp between the second and third nodes,including the search for the node prior to insertion.You are to make clear the sequence of steps by either numbering the steps,or by making several copies of this drawing,with one change per drawing,numbered to show the sequence.You may assume a search routine taking a head node and data has been defined for you. Give code and the drawing to make clear what you are doing.
Question 25
Essay
Given the doubly linked list in the diagram below,give the code to delete the second node in the list with the number 31.Assume each entry in the list is a node of class Node with a public next and prev member variable.
Question 26
Essay
Describe why a very large hash table will likely increase the performance (i.e.faster additions and lookup)at the expense of wasting memory,and vice versa,why a small hash table will use less memory but result in a decrease in performance.