Exam 13: Pointers and Linked Lists

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Given the following declarations, which statement would allocate memory for the first item in the list? Struct Node { Int item; Node* link; }; Typedef Node* NodePtr; NodePtr head;

(Multiple Choice)
4.9/5
(35)

As defined in the text, the pointer variable head

(Multiple Choice)
4.8/5
(39)

The pointer in a node points to

(Multiple Choice)
4.7/5
(33)

Which operator * or .) has higher precedence?

(Short Answer)
4.9/5
(38)

If you push the following numbers onto an integer stack, what item is on the top of the stack? 1,4,8,16)

(Multiple Choice)
4.9/5
(41)

Given the following function declaration Void insert NodePtr afterMe, int num); //PRE: afterMe points to some node in the non-empty list //POST: A new node containing num is inserted after afterMe. Void insertNodePtr afterMe, int num) { // which of the following function definitions correctly implement this //function? }

(Multiple Choice)
4.8/5
(30)

The actual value of NULL is

(Multiple Choice)
4.9/5
(35)

Given the following stack declaration, which of the following function definitions would correctly push an item onto the stack? Struct StackFrame { Char data; StackFrame *link; }; Typedef StackFrame* StackFramePtr; Class Stack { Public: Stack ); Stackconst Stack& a_stack); ~Stack ); Void pushchar the_symbol); Char pop ); Bool empty ) const; Private: StackFramePtr top; };

(Multiple Choice)
4.8/5
(38)

Removing data from a stack is called popping the stack.

(True/False)
4.9/5
(37)

If you write a linked list class, then you should implement the destructor, copy constructor, and the assignment operator

(True/False)
4.8/5
(29)

If NodeTypePtr is defined to be a pointer type to a node in a linked list, then the declaration NodeTypePtr head;

(Multiple Choice)
4.9/5
(35)

The discipline for a stack is:

(Multiple Choice)
4.8/5
(36)

Which of the following loops correctly uses iter as an iterator to move through the nodes of the linked list? NodePtr iter; //a pointer to a node

(Multiple Choice)
4.8/5
(39)

When adding a node to a linked list, which pointer variable do you update first?

(Short Answer)
4.8/5
(43)

Apart from constructors, the operations for a stack listed in the text are ____________, _____________, and _______________,

(Short Answer)
4.8/5
(37)

Given the following declarations, which statement would put the value of 3 in the item part of the first node in the linked list? Struct Node { Int item; Node* link; }; Typedef Node* NodePtr; NodePtr head; Head = new Node;

(Multiple Choice)
4.7/5
(42)

The function used to get the data at the top or front) of the stack is called _______.

(Short Answer)
4.9/5
(38)

Apart from constructors, the operations for a queue listed in the text are ____________, _____________, and _______________,

(Short Answer)
4.8/5
(37)

When would you use a linked list over an array or a dynamic array?

(Multiple Choice)
4.8/5
(39)

You can define a stack that will hold _________-

(Short Answer)
4.9/5
(41)
Showing 41 - 60 of 64
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)