Week 4 Flashcards

1
Q

Linear Data Structure

A

A collection of nodes (elements) where each node has a unique predecessor and a unique successor

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

What is static array?

A

A static array is a static structure

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

Advantages

A

*Faster access to each entry as long as the index is known - O(1) to visit arr[i]

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

Disadvantages

A

*Fixed size - cannot be easily extended or reduced to fit the data set
*Can be expensive to maintain

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

Limitations of using an array (Searching)

A

*Unsorted data - linear search (Efficiency O(n))
*Sorted data - binary search (Efficiency O(log2n))

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

Limitations of using an array (Insertion)

A

*Unsorted data - (Efficiency O(1))
*Sorted data - (Efficiency O(n))

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

Limitations of using an array (Deletion)

A

*Unsorted data - (Efficiency O(1))
*Sorted data - (Efficiency O(n))

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

What is Linked List ?

A

*A collection of objects, called nodes
*A dynamic data structure
(The number of nodes in the list is not fixed)
(The linked list can grow and shrink on demand)

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

Components of every node

A

*information - to be stored (the data)
*reference - to the next node (often called a link)

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

Advantages

A

*Easily extended or reduced to fit the data set
*Efficient - O(1) to insert / delete item, once located

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

Disadvantages

A

*Does not allow direct access to individual items
*Uses more memory compared to an array

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

Components of accessing SLL

A

*head
(Static variable)
(Contains a reference to the first node)
*head.data
(accesses data sorted in the first node)
*head.link
(reference to the second node)

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

Other types of Linked Lists

A

*Singly Linked List with a Dummy Node
*Circular Singly Linked List
*Doubly Linked List
*SkipList

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

SkipList Data Structure

A

*Probabilistic data structure
*Based on a set of parallel linked lists
*Has improved efficiency, compared to a SLL, for must operations

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

Orders in SkipList

A

*Extension of an ordered SLL with additional forward links, added in a randomized way
*Effect - During a search we can skip parts of the list
*Efficiency - On average all operations are performed in logarithmic randomized time O(log2n)

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

SkipList Deletion(Part 1)

A

*Determine level by using a probabilistic technique: A random number generator to determine level of insertion
*Find where to insert: You will need to build an array to hold references for each level
*Insert by adjusting references at each level

17
Q

SkipList Deletion(Part 2)

A

*Need to build an update array during the search for the item to be deleted
*Nodes specified by the update array will have their forward references adjust around the node to be deleted