Exam 13: Pointers and Linked Lists

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

In the following search function for a linked list using the Node and NodePtr as defined in the text), why is there code to check if here is NULL? NodePtr searchNodePtr head, int target) { NodePtr here = head; Ifhere == NULL) { Return NULL; } Else { While here->data != target && here->link != NULL) { Here = here->link; } Ifhere->data == target) { Return here; } Else { Return NULL; } } }

(Multiple Choice)
4.9/5
(42)

Most applications that use a stack will store a struct or class object on the stack.

(True/False)
4.7/5
(44)

*head.item is the same as *head).item

(True/False)
4.9/5
(36)

A _______ is a list constructed using pointers.

(Short Answer)
4.8/5
(42)

The last node in a linked list as defined in the text should always point back to the head of the list.

(True/False)
4.9/5
(23)

The stack can be compared to a line of people at a bank, where the first person in line is the first person served.

(True/False)
4.8/5
(30)

The first node in a linked list is generally named _________

(Short Answer)
4.9/5
(38)

Data is removed at the back of the queue.

(True/False)
4.9/5
(38)

In a linked list as defined in the text, the pointer in the last node in the list should always point to _________.

(Short Answer)
4.8/5
(40)

The function used to put data into a stack is typically called _______.

(Short Answer)
4.8/5
(48)

A linked list is not fixed in size.

(True/False)
4.8/5
(43)

The arrow operator ->) combines the actions of which two operators?

(Short Answer)
4.8/5
(35)

If you need to access the last element of a linked list with N nodes in it, how many comparisons do you need to make to find the last element?

(Multiple Choice)
4.9/5
(40)

You can directly access the nth node of a linked list

(True/False)
4.8/5
(33)

A stack exhibits ______________ behavior

(Multiple Choice)
4.7/5
(32)

A _________ is a struct or class object that has one or more member variables that are pointer variables.

(Short Answer)
4.8/5
(32)

The stack exhibits last-in/first-out behavior

(True/False)
4.9/5
(38)

A stack can be implemented using a __________.

(Short Answer)
4.9/5
(35)

What is wrong with the following definition of headInsert? Struct Node { Int item; Node* link; }; Typedef Node* NodePtr; Void headInsertNodePtr& head, int data) { NodePtr tmp = new Node; Tmp->item = data; Head->next = tmp; Tmp->next = head->next; } NodePtr head; HeadInserthead, 4);

(Multiple Choice)
4.8/5
(41)

If you need to insert an element in the front of a list with N nodes and move the other elements back one place), how many nodes do you have to move?

(Multiple Choice)
4.8/5
(34)
Showing 21 - 40 of 64
close modal

Filters

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