DATA STRUCTURES AND
ALGORITHMS FINAL EXAM
Stack - Correct Answers -Organizes its entries according to the order in which they
were added. Last In - First Out
Binary Operator - Correct Answers -When an operator has two operands ie: a + b
Unary Operator - Correct Answers -When an operator has one operand ie: -5
Infix Expression - Correct Answers -When a binary operator is between expressions
Prefix Expression - Correct Answers -When the operator is before the expression.
Postfix Expression - Correct Answers -When the operator is after the expression
Program Counter - Correct Answers -When a program executes, a special location
called the program counter references the current instruction.
Activation Record/Frame - Correct Answers -When a method is called, the programs
run-time environment creates an objected called the activation record/frame
Java Stack/Program Stack - Correct Answers -At the time the program is called, the
activation record is pushed onto a stack called the Java Stack or the Program Stack
Queue - Correct Answers -Organizes entries according to the order in which they were
added. First in - First out.
Full and Complete Binary Trees - Correct Answers -When a binary tree of height h has
all of its leaves at level h and every nonleaf parent has exactly two children, the tree is
said to be full.
Balanced binary trees. - Correct Answers -When each node in a binary tree has two
subtrees whose heights are exactly the same.
preorder traversal - Correct Answers -When you visit the root before we visit the roots
subtrees. We then visit all the nodes in the roosts left subtree before we visit the nodes
in the right subtree. Example of depth-first traversal.
ALGORITHMS FINAL EXAM
Stack - Correct Answers -Organizes its entries according to the order in which they
were added. Last In - First Out
Binary Operator - Correct Answers -When an operator has two operands ie: a + b
Unary Operator - Correct Answers -When an operator has one operand ie: -5
Infix Expression - Correct Answers -When a binary operator is between expressions
Prefix Expression - Correct Answers -When the operator is before the expression.
Postfix Expression - Correct Answers -When the operator is after the expression
Program Counter - Correct Answers -When a program executes, a special location
called the program counter references the current instruction.
Activation Record/Frame - Correct Answers -When a method is called, the programs
run-time environment creates an objected called the activation record/frame
Java Stack/Program Stack - Correct Answers -At the time the program is called, the
activation record is pushed onto a stack called the Java Stack or the Program Stack
Queue - Correct Answers -Organizes entries according to the order in which they were
added. First in - First out.
Full and Complete Binary Trees - Correct Answers -When a binary tree of height h has
all of its leaves at level h and every nonleaf parent has exactly two children, the tree is
said to be full.
Balanced binary trees. - Correct Answers -When each node in a binary tree has two
subtrees whose heights are exactly the same.
preorder traversal - Correct Answers -When you visit the root before we visit the roots
subtrees. We then visit all the nodes in the roosts left subtree before we visit the nodes
in the right subtree. Example of depth-first traversal.