Exam 17: Linked Data Structures

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

The link field in the last node in a linked list has a special value stored in it.What is it? It has a special name.What is the special name? Why is this done?

(Essay)
4.8/5
(39)

Given the type definitions: const int STRING_SIZE = 20; struct ListNode { \quad char item[STRING_SIZE]; \quad int count; \quad ListNode * link; }; What is the output produced by the following code? (As always,you are to assume that the code is embedded in a correct and complete program. ListNode * head = new ListNode; strcpy( head->item,"Stop Light"); head->count = 10; cout << (*head).item << endl; cout << head->item << endl; cout << (*head).count << endl; cout << head->number << endl;

(Short Answer)
4.9/5
(40)

A queue is first-in-first-out data structure.

(True/False)
5.0/5
(34)

There is no need for error checking when popping a stack.

(True/False)
4.8/5
(31)

A stack is a first-in-first-out data structure.

(True/False)
5.0/5
(39)

Removing data from a stack is called popping the stack.

(True/False)
4.8/5
(50)

A tree is a recursive structure.

(True/False)
4.8/5
(38)

Given the structure definition: const int STRING_SIZE = 20; struct ListNode { \quad char item[STRING_SIZE]; \quad int count; \quad ListNode *link; }; ListNode *head = new ListNode; Give code to assign the string "Wilbur's brother Orville" to the member item of the variable to which head points.Hint: you need a function declared in cstring.

(Essay)
4.9/5
(33)

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.

(Essay)
4.9/5
(31)

There is no need for error checking when pushing a stack.

(True/False)
4.9/5
(43)
Showing 21 - 30 of 30
close modal

Filters

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