Final Flashcards

1
Q

bubble sort

A

considers objects in pairs, swaps them if they’re in wrong order, largest unsorted item bubbles to top

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

pros of bubble sort

A

simple to write, little memory is used, easy to understand

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

cons of bubble sort

A

takes a very long time with large amounts of data, goes through list several times making it slow

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

merge sort

A

divide and conquer, cuts list down into sublists

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

pros of merge sort

A

faster for larger lists, has consistent running time

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

cons of merge sort

A

uses more memory to store sublists, goes through entire process even if list is sorted

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

selection sort

A

repeatedly finds minimum element from unsorted part and puts it at beginning

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

pros of selection sort

A

performs well on small lists, does not require additional storage

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

cons of selection sort

A

not efficient for large lists

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

insertion sort

A

repeatedly scans lists of items, inserting the item into its correct position

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

pros of insertion sort

A

simple, good for small lists, requires minimal storage

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

cons of insertion sort

A

does not work well w/large lists, does not perform as well as other algorithms

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

quick sort

A

divide and conquer, puts list into sublists

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

pros of quick sort

A

efficient in dealing w/large lists, no additional storage necessary, sorts lists of any size easily

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

cons of quick sort

A

its worst performance is similar to that of bubble sort, insertion, or selection

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

counting sort

A

counts the number of objects having distinct key values, calculates position of each object in the output sequence

17
Q

pros of counting sort

A

easy to code, performs generally faster than other algorithms

18
Q

cons of counting sort

A

does not work on decimal values, ineffcient if range is very large

19
Q

radix sort

A

creates/distributes elements into buckets according to their radix

20
Q

pros of radix sort

A

fast when keys are short, stable bc it maintains relative order of elements w/equal values

21
Q

cons of radix sort

A

less flexible, takes up more space, slow if operations are inefficient

22
Q

binary search

A

search begins at middle of list, finds item or eliminates half of unexamined items, repeats until item is found, finding number in 7 tries example

23
Q

sequential search

A

starts at beginning of list searches the entire list until the item is found

24
Q

what shape starts and ends a flow chart?

A

oval

25
Q

what shape is used for input/output

A

parallelogram

26
Q

what shape is used for processing

A

rectangle

27
Q

what shape is used for decision making (IF condition)

A

diamond