# Exam Review 314

### 148 terms by WinstonUTCS

#### Study  only

Flashcards Flashcards

Scatter Scatter

Scatter Scatter

## Create a new folder

CS 314 The University of Texas

O(N)

O(log(N))

O(1)

O(N)

O(N)

O(1)

O(N)

O(log(N))

O(n*log(N))

O(n²)

O(n³)

Slowly

1

3

O(N)

32

9

19

19

Polynomial

### When there is a straight line on a log-log graph, what does the slope represent?

The order of the polynomial

Exponential

### What does it mean for a function to be intractable?

It can only be computed when n is relatively small (for example, exponential)

O(n)

O( n*log(n) )

O(n²)

O(n³)

### How can you find the Big O of a loop?

The loop count times the Big O of the contents

### How can you find the Big O of an if statement?

The max of the Big O of the test, then statement, and else statement

O(n²)

### What is a pointer (aka reference)?

The memory address of the beginning of a record, or block of storage

32 bits

### What is sometimes called a boxed integer?

A record that contains other pointers

### For reference types, what do == and != test?

The equality of pointer values (i.e. do they have the exact same data address in memory?)

.equals()

== or !=

### To make an Integer out of an int, what should be used?

Integer myInteger = Integer.valueOf(myInt)

### What is a linked list?

A data structure where each element has two fields: a link and contents

A pointer to the next element

### What are contents of a linked list?

Something as simple as a number, or a pointer to another linked list

### How does the constructing of a linked list work?

A linked list links new elements onto the front of the list.

### What does the function (cons item list) do?

It makes a new list element containing item, and adds it to the front of list

(a b c)

car and cdr

### In a Cons list, first and rest have different types. What are they?

First can be any Object type, while rest is a Cons or null

null

### With respect to linked lists, what does .set(idx, element) do?

Replaces the element at the specified position in this list with the specified element.

### With respect to linked lists, what does the function length produce?

The number of "things" in the linked list

### What is a "thing" concerning linked lists?

A simple item such as a number or string or a balanced pair of parenthesis and everything inside of them.

### What does a recursive program do?

It calls itself as a subroutine.

### What are base cases?

Simple inputs for which the answer is obvious and can be determined immediately.

### What does the function reverse do to a linked list?

It makes a new linked list whose elements are in reverse order of the original list

### What does the function append do to a linked list?

It concatenates two lists to form a single list.

### What is a constructive function?

A function that creates a new list, but does not modify the original list's arguments

### What does it mean for functions to share structure?

The same list structure is part of more than one list.

### What is a destructive argument?

A function that creates a list but modifies the original list's arguments

### What does the function nconc do?

It concatenates two lists to form a single list; it does so by modifying the end of the first list to point to the second list

### What does the function nreverse do?

It reverses a list in place by turning the pointers around.

### What does the function member do?

It tests whether a given item is an element of a list. It returns the remainder of the list beginning with the desired element

(dick harry)

### What does the function Intersection do?

It returns a set of elements that are members of both sets

(c a)

### What does the function Union do?

It returns the set of elements that are members of either set (basically all elements with no duplicates)

### What is a circularly linked list?

The last link points back to the front of the list rather than to null or nil

### What is a doubly linked list?

It has pointers that point both forward and backward

### What does the function merge do?

It combines two sorted lists into one sorted list

### What does it mean to divide and conquer?

To break down a large problem into two smaller problems, until the problem becomes easy

### What does the function assoc do?

It provides a simple lookup tool to find information in a linked list

### What is an abstract data type?

a description of operations on a data type that could have multiple possible implementations.

### What is an association list?

It is a list of pairs, where each pair has a key, and a value associated with the key

### What is a Cons?

The function that constructs a pair of pointers

### What does depth-first search do?

It searches children of a node before siblings are considered (through recursion)

### What is design pattern?

a pattern that describes a set of similar programs

### What is garbage?

it can be data that is incorrect, meaningless, or random, or storage that is no longer pointed to

### What is an object?

a data structure that can be identified at runtime as a member of a class

### What is a parent?

In a tree, it is a node that points to a given node

### What is preorder?

a way of processing a tree where the parent node is processed before the children

### What is random access?

describes a data structure in which all accesses have the same costs

### What is a reference?

A pointer to data

### What is a runtime stack?

a stack that keeps a fresh set of values for each variable in a stack frame

### What is XML?

Extensible Markup Language, it allows users to put tags around their data to describe what the pieces of data mean

A queue

enqueued

dequeued

### What is a fair data structure?

An entry in a queue will eventually get serviced and removed so a queue is fair

### What will a filter function do?

Filter removes items from a Collection if they meet a certain condition

### What are the advantages to ArrayList?

get and set are O(1), and add and remove at the end are O(1) so it makes a good stack

### What are the disadvantages of ArrayList?

add and remove are O(N) for randoms, contains is O(N)

get, set, and remove are O(N)

### What is a tree?

A kind of graph composed of nodes and links

A directed pointer from one node to another

### What is a root?

The uppermost node that has no incoming links

Exactly one

Any number

a leaf

### What are the different representations of trees that we are concerned with for Novak's class?

Binary trees, First-Child/Next-sibling, Linked lists, Implicit

### What is a binary tree?

A tree in which each node has at most two children

### What is a First-Child / Next-Sibling Tree?

Down arrows represent the first child, while side arrows represent the next sibling

### What is the best way to remember how to draw a FC/NS Tree?

The right hand nodes all fall down

### What is the goal?

The item being sought in a search

### What is inorder?

an order of processing a tree in which the parent node is processed in between its children

nothing

### state

a description of a state of a process, such as a board game

### What is well-founded ordering?

ordering that can guarantee to terminate (go down to zero)

### Abstract Data Type

a description of operations on a data type that could have multiple possible implemations

### ASCII

A character code that maps between 8-bit binary integers and characters.

### Base Case

a simple case that can be solved easily, without recursion.

...

### child

in a tree, a node pointed to by a parent node.

### class

in object-oriented programming, a description of a set of similar objects.

### depth

the number of links between the root of a tree and the leaves.

### descendants

all nodes below a given tree.

### DFS

Depth first search

### fair

describes a process in which every arriving customer will eventually be served.

### first-child/next-sibling

a way of implementing trees that uses two pointers per node but can represent an arbitrary number of children of a node.

### gedanken

describes a thought experiment or view of an entity.

### immutable

describes a data structure that canot be changed once it has been created, such as Integer or String in Java.

### interpreter

a program that reads instructions, determines what they say, and executes them. The CPU is an interpreter for machine languages; the JVM is an interpreter for compiled.

### JVM

Java Virtual Machine

### linear

O(n) a problem whose solution requires a linear amount of time or space if the problem is size n.

### ancestors

in a tree, the union of a node's parent and the parent's ancestors.

### array

A contiguous block of memory containing elements of the same type, accessed by numeric index.

### association list

a list of pairs, where each pair has a key and a value associated with the key.

### backtrack

in a tree search, to move back from the node from the node currently being examined to it's parent

### Big O

an abstracted function that describes the amount of problem size. For problems lager than a certain time, the actual time or space required will be less than the Big O multiplied by some constant.

### binary tree

a tree in which each node has at most two children.

### boxed number

a number that is defined as an object, so that it has a runtime type and methods that can be used, e.g. Integer in Java

### branching factor

in a search tree, the number of children of a given node.

a linked list in which the last element points back to the first element.

### circular queue

a queue implemented within an array, where the first element of the array logically follows the last element.

### cons

in Lisp,the function that constructs a pair of pinters, or basic element of list structure. a cons structure. to make a cons data structure.

### constructive

makes a new data structure but does not modify it's arguments.

### depth-first search

a search in which children of a node are considered(recursively) before siblings are concerned.

### dereference

to convert from a pointer (address) to the data that is pointed to.

### descendants

all nodes below a given node in tree.

### design pattern

a pattern that describes a set of similar programs

### destructive

describes a function that modifies it's arguments

### divide and conquer

a problem-solving strategy inwhich a problem is broken down into sub-problems, until simple subproblems are related.

a linked list in which each element has both forward and backward pointers

### FIFO

first item into the structure is the first one out.

### filter

a process that removes unwanted elements from a collection.

### garbage

data that is incorrect, meaningless, or random.

### garbage collection

the process of collecting garbage for recycling

### goal

an item, being sought in a search

### grammar

a formal description of a language in terms of vocabulary and rules for writing phrases and sentences.

### inorder

an order of processing a tree in which the parent node is processed between it's children.

Example: