Lesson 1 Flashcards

Arrays

1
Q

An ____ is a data structure used to store multiple elements.

A

array

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

Arrays are_______, meaning that each element in the array has an index, a number that says where in the array the element is located.

A

indexed

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

_________ is an algorithm that sorts an array from the lowest value to the highest value

A

Bubble Sort

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

The ________ algorithm finds the lowest value in an array and moves it to the front of the array.

A

Selection Sort

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

The __________algorithm uses one part of the array to hold the sorted values, and the other part of the array to hold values that are not sorted yet.

A

Insertion Sort

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

The ________ algorithm takes an array of values, chooses one of the values as the ‘pivot’ element, and moves the other values so that lower values are on the left of the pivot element, and higher values are on the right of it

A

Quicksort

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

________ is when a function calls itself.

A

Recursion

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

The _______ algorithm sorts an array by counting the number of times each value occurs.

A

Counting Sort

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

The _____ algorithm sorts an array by individual digits, starting with the least significant digit (the rightmost one).

A

Radix Sort

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

The _________ algorithm is a divide-and-conquer algorithm that sorts an array by first breaking it down into smaller arrays and then building the array back together the correct way so that it is sorted.

A

Merge Sort

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

The _________ algorithm searches through an array and returns the index of the value it searches for.

A

Linear Search

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

The ________ algorithm searches through an array and returns the index of the value it searches for.

A

Binary Search

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

A list where the nodes are linked together

A

Linked List

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

Each _____ contains data and a pointer

A

node

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

_________ is the storage your program uses when it is running. This is where your variables, arrays and linked lists are stored.

A

Computer memory

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

Function allocates memory for a new node, fills in the data part of the node with an integer given as an argument to the function, and returns the pointer (memory address) to the new node.

A

createNode()

17
Q

Function is just for going through the linked list and printing each node’s value.

A

printList()

18
Q

Inside the ______ function, four nodes are created, linked together, printed, and then the memory is freed

A

main()

19
Q

There are three basic forms of linked lists

A

Singly linked lists
Doubly linked lists
Circular linked lists

20
Q

A ________ is the simplest kind of linked lists. It takes up less space in memory because each node has only one address to the next node.

A

singly linked list

21
Q

A _______ has nodes with addresses to both the previous and the next node, and therefore takes up more memory

A

doubly linked list

22
Q

A _______ is like a singly or doubly linked list with the first node, the “head”, and the last node, the “tail”, connected.

A

circular linked list