Exam 8: Data Abstractions
Exam 1: Data Representation64 Questions
Exam 2: Data Representation63 Questions
Exam 3: Operating Systems47 Questions
Exam 4: Networks and the Internet62 Questions
Exam 5: Algorithms53 Questions
Exam 6: Programming Languages54 Questions
Exam 7: Software Engineering54 Questions
Exam 8: Data Abstractions53 Questions
Exam 9: Database Systems52 Questions
Exam 10: Computer Graphics47 Questions
Exam 11: Artificial Intelligence52 Questions
Exam 12: Theory of Computation51 Questions
Select questions type
What sequence of nodes from the tree
would be printed if the following recursive procedure were applied to it? (The procedure uses a global stack called Stack that is assumed to begin empty.)
def printTree (Tree)
Stack.push(Tree.Left);
if (Tree.Right != None):
printTree(Tree)
print(Stack.pop())

(Short Answer)
4.8/5
(27)
Define each of the following:
A.Primitive data type
B.User-defined data type
C.Abstract data type
(Essay)
5.0/5
(38)
If the longest path in a binary tree contained exactly four nodes,what is the maximum number of nodes that could be in the entire tree?
(Multiple Choice)
4.8/5
(38)
The table below represents a portion of a computer's main memory containing a binary tree stored row by row in a contiguous block as described in the chapter.Draw a picture of the tree.
Address Contents 50 A 51 B 52 C 53 D 54 E 55 F 56 G
(Essay)
4.7/5
(41)
Suppose the expression X[1,1] referred to the first-row,first-column entry in a two-dimensional array with 5 rows and 7 columns.If the array is stored in row-major order beginning at memory address x and each entry in the array requires n memory cells,what address polynomial would be used to compute the address of the beginning of the entry X[I,J]?
________________
(Short Answer)
4.8/5
(28)
Suppose the expression X[0,0] referred to the first-row,first-column entry in a two-dimensional array with 5 rows and 7 columns.If the array is stored in column-major order beginning at memory address x and each entry in the array requires n memory cells,what address polynomial would be used to compute the address of the beginning of the entry X[I,J]?
(Short Answer)
4.8/5
(36)
The table below represents a portion of a computer's main memory containing a binary tree.Each node consists of three cells,the first being data,the second being a pointer to the node's left child,and the third being a pointer to the node's right child.If the null pointer is represented by 00 and the tree's root pointer contains 53,how many terminal nodes are in the tree?
Address Contents 50 51 00 52 00 53 54 00 55 56 56 57 00 58 00
(Short Answer)
4.9/5
(38)
In a machine language,the technique in which an instruction contains the location of a pointer to the data to be manipulated is called
(Multiple Choice)
4.8/5
(33)
In which direction does an unchecked queue crawl through memory (in the direction of its head or in the direction of its tail)?
(Short Answer)
4.8/5
(33)
The table below represents a portion of a computer's main memory containing a binary tree stored row by row in a contiguous block as described in the chapter.What are the children of the node B?
Address Conten 50 51 52 53 54 55 56
(Short Answer)
4.9/5
(38)
The table below represents a portion of a computer's main memory containing a binary tree stored row by row in a contiguous block as described in the chapter.What is the parent of the node Z?
Address Contents 50 51 52 53 54 55 56
(Multiple Choice)
4.9/5
(39)
Suppose the following Java code was used to implement an abstract data type for a stack of integers:
class StackOfIntegers implements StackType
{
private int[] StackEntries = new int[20];
private int StackPointer = 0;
public void push(int NewEntry)
{
if (StackPointer < 20)
StackEntries[StackPointer++] = NewEntry;
}
...
A.What would be the value of the variable StackPointer associated with Stack2 after executing the statements
StackType Stack1,Stack2;
Stack1.push(5);
Stack2.push(6);
Stack2.push(7);
B.What would be the value of StackEntries[0] associated with Stack1 after executing the statements in part A?
C.What would be the value of StackEntries[1] associated with Stack2 after executing the statements in part A?
D.What would be the value of StackEntries[0] associated with Stack2 after executing the statements in part A?
(Essay)
4.8/5
(34)
Which of the following is static in the sense that it does not change size or shape as information is stored and retrieved?
(Multiple Choice)
4.9/5
(40)
Suppose the following Java code was used to implement an abstract data type for a stack of integers:
class StackOfIntegers implements StackType
{
private int[] StackEntries = new int[20];
private int StackPointer = 0;
public void push(int NewEntry)
{
if (StackPointer < 20)
StackEntries[StackPointer++] = NewEntry;
}
A.What would be the value of the variable StackPointer associated with Stack after executing the statement
StackType Stack;
B.Then,what would be the value of StackPointer associated with Stack after executing the statement
Stack.push(5);
(Short Answer)
4.7/5
(30)
If a queue contained the entries B,C,D (from head to tail),what would be the contents of the queue (again from head to tail)after one entry was removed and the entry A was inserted?
(Short Answer)
4.7/5
(38)
The table below represents a portion of a computer's main memory containing a binary tree stored row by row in a contiguous block as described in the chapter.What is the left child of the node V?
Address Contents 50 T 51 U 52 V 53 W 54 X 55 Y 56 Z
(Multiple Choice)
4.9/5
(34)
Showing 21 - 40 of 53
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)