CIS 120 Introduction to Data Structure Final

¡Supera tus tareas y exámenes ahora con Quizwiz!

True False: A Directed Graph can only use a Matrix to store its data.

False

True False: Python is an object-oriented language and uses a compiler.

False

True False: Sets are unordered collections, where position not value matters.

False

True False: "Collections" are a group of zeros or more items treated as a unit.

True

True False: A main reason an Array is different from a Linked List, the size of the arrays is fixed, Linked Lists are Dynamic in size.

True

True False: An algorithm is a set of rules that solves a business problem.

True

True False: Item Class and Dictionary both use value/key pairs.

True

True False: Queues don't allow random access to their objects because it is an ordered list.

True

True False: Stacks do not allow random access to their objects because it is an ordered list.

True

What is a list? a. A linear collection of data items concerned with how the data is sequenced. b. A linear collection of data items not concerned with how the data is sequenced. c. A non-linear collection of data items concerned with how the data is sequenced.

a. A linear collection of data items concerned with how the data is sequenced.

What is a Stack? a. A linear data structure that uses Last In First Out (LIFO) or First In Last Out (FILO). b. A linear data structure that use Last in First Out (LIFO) only. c. A non-linear data structure that use Last in First Out (LIFO) or First in Last Out (FILO).

a. A linear data structure that uses Last In First Out (LIFO) or First In Last Out (FILO).

How do you check if a given Binary Tree is BST? a. A program that checks If the "inorder" traversal is sorted. b. A program that checks if the "level order" traversal is sorted. c. A program that checks if the "preorder" traversal is sorted.

a. A program that checks If the "inorder" traversal is sorted.

What is a Class in Python? a. Code that creates an object, it starts with "Class". b. Code that creates an object, it starts with "def". c. Code that creates a function, it starts with "Class".

a. Code that creates an object, it starts with "Class".

What is an implementation? a. Is a set of publicly accessible methods on an object which can be used by other parts of the program to interact with that object. b. Two separate methods which can be used by other parts of the program to interact with that object. c. Is a set of privately accessible methods on an object which can be used by other parts of the program to interact with that object.

a. Is a set of publicly accessible methods on an object which can be used by other parts of the program to interact with that object.

What are linear and non-linear data Structures? a. Linear: sequence or list of items. Non-Linear: items are attached to more than one item reflective of a relationship. b. Linear: sequence or list of items. Non-Linear: traversal is sequenced. c. Linear: straight line. Non-Linear: Tree-based.

a. Linear: sequence or list of items. Non-Linear: items are attached to more than one item reflective of a relationship.

What is a Linked List? a. A non-linear data structure where each element is a separate object, containing the data and a reference to the next element. b. A linear data structure where each element is a separate object, containing the data and a reference to the next element. c. A linear data structure where two elements become a separate object by sharing data and references.

b. A linear data structure where each element is a separate object, containing the data and a reference to the next element.

What is inheritance in Python? a. A new Subclass in another Class takes on the features and behaviors of a Class. b. A new Subclass in a Class takes on the features and behaviors of that Class. c. A new Class takes on the features and behaviors of another Class.

b. A new Subclass in a Class takes on the features and behaviors of that Class.

The expressions O(n), O(n2), and O(kn) are respectively? a. Exponential, linear, and quadratic. b. Linear, quadratic, and exponential. c. Logarithmic, linear, and quadratic.

b. Linear, quadratic, and exponential.

What collections are examples of Immutable, Mutable? a. Mutable: function. Immutable: Class. b. Mutable: list, set, dictionary. Immutable: string, tuple. c. Mutable: string, tuple. Immutable: list, set, dictionary.

b. Mutable: list, set, dictionary. Immutable: string, tuple.

What is an abstrctClass in Python? a. A Class that contains more than one method for inheritance. b. A Class that cannot be inherited through a method. c. A class that contains at least one abstract method.

c. A class that contains at least one abstract method.

What is a Queue? a. A linear structure that uses Last In First Out (LIFO). b. A non-linear structure that uses First In First Out (FIFO). c. A linear structure that uses First In First Out (FIFO).

c. A linear structure that uses First In First Out (FIFO).

In a Binary Tree, when a node has only 1 child it is called what? a. An orphaned parent. b. A left-branch child or right-branch child. c. A right child or left child.

c. A right child or left child.

What is a function in Python? a. Code block that is reusable and performs different actions. b. A program that performs an action. c. Code block that is reusable and performs an action.

c. Code block that is reusable and performs an action.

What is polymorphism? a. Commonly named methods in the same Class or Subclass. b. Commonly named Subclasses across several Classes. c. Commonly named methods across several Classes or Subclasses.

c. Commonly named methods across several Classes or Subclasses.

How does a programmer code the size of an array? "X" represents the number size for this question. a. A=Array_x() b. A=Array()"x" c. a=Array(x)

c. a=Array(x)


Conjuntos de estudio relacionados

Psych Chapter 12: Psychological Disorders

View Set

QA питання по теорії

View Set

BIOL 465 - Molecular Basis of Cancer: Lectures 1 & 2

View Set

Chapter 1 - Review (SHORT ANSWERS - Partly) Questions

View Set