Data Structures Overview Terms & Concepts Flashcards

1
Q

array

A

primitive data structure
collection of items
stored sequentially

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

array insertion

A

new value placed in arbitrary position

all following elements move over one position to make room

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

array index

A

access any item

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

abstract data type (ADT)

A

a scheme for organizing data that is independent of how it is stored in the computer
defined by a name and list of operations that can be performed on it

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

List ADT operation: Size

A

get the number of items in the list

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

List ADT operation: Get

A

get the value at a specific location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

List ADT operation: Find

A

find the location of a matching element

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

List ADT operation: insert

A

put a new value into the list at a specific location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

List ADT operation: remove

A

take a value out of the list at a specific location

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

List ADT operation: Set

A

replace one item with another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

big-O notation

A

tool for measuring operation execution speed
dependent on data type and implementation
“order of”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Efficiency of List ADT Size operation implemented with an array

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Efficiency of List ADT Get operation implemented with an array

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Efficiency of List ADT Find operation implemented with an array

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Efficiency of List ADT Set operation implemented with an array

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Efficiency of List ADT insert operation implemented with an array

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Efficiency of List ADT Add at end operation implemented with an array

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Efficiency of List ADT Remove operation implemented with an array

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Efficiency of List ADT Sort operation implemented with an array

A

O(n log n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

Efficiency of Ordered List ADT Size operation implemented with an array

A

usually O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

Efficiency of Ordered List ADT Get operation implemented with an array

A

O(1)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Efficiency of Ordered List ADT Find operation implemented with an array

A

O(log n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Efficiency of Ordered List ADT Insert operation implemented with an array

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Efficiency of Ordered List ADT Remove operation implemented with an array

A

O(n)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

Set ADT

A

like a list that doesn’t allow duplicates, but the position of items in the collection is undefined and irrelevant.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

Set ADT operations

A

Add, In, Intersection, Union

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

Set ADT operation: Add

A

add an item to the set

28
Q

Set ADT operation: In

A

is an item in the set?

29
Q

Set ADT operation: Intersection

A

Return the intersection of two sets

30
Q

Set ADT operation: Union

A

Return the union of two sets

31
Q

test in isolation

A

get your ADT working separately from the main program by creating new main program from scratch

32
Q

toString method

A

always written for ADTs
outputs results
when printing out a reference, toString called automatically, without explicit call

33
Q

boundary testing

A

using a testing method for values at the start and end of a collection

34
Q

intersection operation

A

the set of all elements the two have in common.

35
Q

orthogonal methods

A

two similar methods, working the same way.

36
Q

union operation

A

all the elements found in either of two sets.

37
Q

refactoring

A

improving code quality without affecting results

38
Q

data structure

A

an arrangement of data in a computer’s memory.

39
Q

algorithm

A

manipulates data in data structures

40
Q

iteration in a data structure

A

visiting each item in turn to perform some action on it

41
Q

recursion

A

a method that calls itself

42
Q

fields

A

an object’s variables

43
Q

instantiating an object

A

creating an object

44
Q

instance

A

object of a class

45
Q

constructor

A
has the same name as the class
called whenever a new object is created
46
Q

access modifiers

A

keywords public and private

determine which methods can access a method or field

47
Q

private

A

a field or method that can only be accessed by methods of the same class

48
Q

public

A

a field or method that can be accessed by methods in other classes

49
Q

inheritance

A
the creation of one class, called the extended or derived class, from another class called the base class.
the extended class has all the features of the base class, plus some additional features
50
Q

polymorphism

A
treats objects of different classes the same way.
different class must be derived from same base class
51
Q

garbage collection

A

blocks of memory with no valid references are returned to the free memory store

52
Q

insertion, searching, deletion operations

A

fundamental to most data structures

53
Q

array hole

A

one or more empty cells that have filled cells above them at higher index numbers

54
Q

initialization list

A

single statement creates a new array with size determined by the number of values in the list.

55
Q

container class

A

a class used to store data objects

56
Q

class interface

A

the functions and arguments of class methods

57
Q

abstraction

A

the process of designing a program by first starting with class functionality rather than implementation details

58
Q

ordered array

A

data items arranged by ascending key values, smallest to largest.

59
Q

binary search

A

for ordered arrays
each guess divides the range of possible values in half until the range is only one number long
the correct number is identified in only seven guesses, this is the maximum.

60
Q

logarithm

A

the inverse of raising something to a power.
the logarithm to the base B of a number A is roughly the number of times you can divide A by B before the result is less than 1.

61
Q

bubble sort

A

slow and simple
compare two items, if item closer to beginning of array is larger than item closer to end, then swap them. move to next pair and swap if necessary, continue to end of array and start over and continue until all ascending.

62
Q

invariants

A

conditions in algorithms that remain unchanged as the algorithm proceeds.

63
Q

selection sort

A

pass through all the items and pick the lowest number, swap the least with the first (position 0). start again at position 1, swap least with position 1. process continues until all sorted.

64
Q

insertion sort

A

partially sorted group. remove first item of unsorted items, shift the sorted items to make room for the item at each position and compare each position until item reaches it’s sorted position, then insert. process repeats until all unsorted items are inserted in sorted positions.

65
Q

operation of compareTo( ) method

A

s2.compareTo(s1)
s1 < s2 - return value is < 0
s1 equals s2 - return value is 0
s1 > s2 - return value > 0

66
Q

stack

A

A collection of objects that are inserted and removed according to the
last-in, first-out (LIFO) principle.