Data Structure 7 Flashcards

1
Q

singly-linked list

A

a data structure for implementing a list ADT, where each node has data and a pointer to the next node

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

doubly-linked list

A

a data structure for implementing a list ADT, where each node has data, a pointer to the next node, and a pointer to the previous node. The list structure typically points to the first node and the last node

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

hash table

A

a data structure that stores unordered items by mapping (or hashing) each item to a location in an array (or vector)

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

binary tree

A

each node has up to two children, known as a left child and a right child.

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

all(list)

A

True if every element in list is True (!= 0), or if the list is empty.

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

any(list)

A

True if any element in the list is True.

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

max(list)

A

Get the maximum element in the list.

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

min(list)

A

Get the minimum element in the list.

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

sum(list)

A

Get the sum of all elements in the list.

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

list nesting

A

a list inside another list
Ex: my_list = [[5, 13], [50, 75, 100]]

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

my_list[start:end]

A

Get a list from start to end (minus 1).
Code:my_list = [5, 10, 20]print(my_list[0:2])
Output: [5, 10]

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

my_list[start:end:stride]

A

Get a list of every stride element from start to end (minus 1).
Code: my_list = [5, 10, 20, 40, 80]print(my_list[0:5:3])
Output: [5, 40]

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

my_list[start:]

A

my_list[start:]

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

my_list[:end]

A

Get a list from beginning of list to end (minus 1).
Code: my_list = [5, 10, 20, 40, 80]print(my_list[:4])
Output: [5, 10, 20, 40]

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

my_list[:]

A

Get a copy of the list.

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

list comprehension

A

A Python construct for creating a list in terms of conditions on other lists

new_list = [expression for name in iterable]

17
Q

dictionary

A

another type of container object that is different from sequences like strings, tuples, and lists. References to objects as key-value pairs - each key in the dictionary is associated with a value

18
Q

dict method

A

a function provided by the dict type that operates on a specific dict object.

19
Q

List

A

an ADT for holding ordered data.
Ex: Array, linked list

20
Q

Stack

A

an ADT in which items are only inserted on or removed from the top of a stack.
Ex: Linked List

21
Q

Queue

A

an ADT in which items are inserted at the end of the queue and removed from the front of the queue.
Ex: Linked List

22
Q

Deque

A

an ADT in which items can be inserted and removed at both the front and back.
Ex: Linked list

23
Q

Bag

A

an ADT for storing items in which the order does not matter and duplicate items are allowed.
Ex: Array, Linked List

24
Q

Set

A

an ADT for a collection of distinct items.
Ex: Binary search tree, hash table

25
Q

Priority queue

A

a queue where each item has a priority, and items with higher priority are closer to the front of the queue than items with lower priority.
Ex: Heap

26
Q

Dictionary (Map)

A

an ADT that associates (or maps) keys with values.
Ex: Hash table, binary search tree

27
Q

algorithm

A

sequence of steps to solve a computational problem or perform a calculation