Font size
WorksheetsData Structures Midterm Exam WRI
Total questions: 27
Worksheet time: 2hrs 15mins
Is ultimately stored in computers as patterns of bits, though these days most programming languages deal with higher-level objects, such as characters, integers, and floating-point numbers.
Array
Data
Array items
Is a collection of similar types of data.
Array
Data
Array items
Typically stored in a sequence of computer memory locations, but to discuss them, we need a convenient way to write them down on paper.
Array
Data
Array items
Is a condition that does not change during the execution of a given program or algorithm.
Loop
Invariants
Index
Arrays work on an _________ system starting from 0 to (n-1), where n is the size of the array.
Index
array
address
Arrays are typically defined with square brackets with the size of the arrays as its argument.
Curly brace
Brackets
Parenthesis
This is a Boolean expression calculated at the beginning of each iteration to determine whether the loop body will execute or stop.
Loop body
Loop update
Loop condition
Loop initialization
We initialize loop variables before starting the first iteration of the loop.
Loop body
Loop update
Loop condition
Loop initialization
We perform increment/decrement operations on loop variables to control repetitions of the loop.
Loop body
Loop update
Loop condition
Loop initialization
The core part of a loop where we perform required operations to manipulate data at each iteration.
Loop body
Loop update
Loop condition
Loop initialization
Must be appropriately defined and true before the loop execution.
Pre-condition
Post-condition
Loop variant
Loop invariant
An exit condition must be appropriately defined to ensure loop termination.
Pre-condition
Post-condition
Loop variant
Loop invariant
The most critical aspect that is true before and after each iteration. The values of variables may change, but the truth of loop invariant does not vary.
Pre-condition
Post-condition
Loop variant
Loop invariant
Involve virtually anything, for example, a list of integers [3, 2, 4, 2, 5], a shopping list [apples, butter, bread, cheese], or a list of web pages each containing a picture and a link to the next web page.
Queues
List
Recursion
Stacks
An abstract level, equivalent to linked lists. They are the ideal data structure to model a First-In-Last-Out (FILO), or Last-In-First-Out (LIFO), strategy in search.
Queues
List
Recursion
Stacks
Is a data structure used to model a First-In-First-Out (FIFO) strategy. Conceptually, we add to the end of a queue and take away elements from its front.
Queues
List
Recursion
Stacks
Is a principle that allows a problem to be defined in terms of smaller and smaller instances of itself. In computing, we solve problems defined recursively by using recursive functions, which, again, are functions that call themselves.
Queues
List
Recursion
Stacks
Might be useful when working with something like a list of web pages, which has each page containing a picture, a link to the previous page, and a link to the next page.
Linked List
Double linked list
Binary Tree
Contains both data and a pointer.
Node
Child Node
Parent
Has at least 1 child node, found by going up the line that connects to a specific node.
Node
Child Node
Parent
(a) of an element is the process of removing the desired element and reorganizing it.
The method of searching for a specific value in an array is known as (a) .
(a) in an array is a process of visiting each element once.
(a) in an array is the process of including one or more elements in an array.
(a) in an array is the process in which it sorts elements in a user-defined order.
Use a comma to separate your answer.
(a)
Use a comma to separate your answer.
(a)
