Fundamentals of Data Structures

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/29

flashcard set

Earn XP

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

30 Terms

1
New cards

What are the 7 different Data Structures?

  • Queue

  • Stack

  • Graph

  • Tree

  • Hash Table

  • Dictionary

  • Vector

QuickSilverGoTHDV

2
New cards

What are the 3 types of Queue?

  • Linear

  • Circular

  • Priority

3
New cards

What are Data Structures?

Data Structures act as containers for data acting almost as a next level sort of Data Type.

4
New cards

What are the 3 rules of Arrays?

  • Must be finite

  • Must be indexed

  • Must contain the same data type

5
New cards

What is the difference between 1 and 2 dimensional arrays?

One is simply linear with only data being labelled by its index, while 2 dimensional arrays look like tables containing a column and row.

<p>One is simply linear with only data being labelled by its index, while 2 dimensional arrays look like tables containing a column and row.</p>
6
New cards

What is an abstract data type?

There truly is no such thing as an abstract data type as all it does is take from other real data types and customize themself in their own way making them different to the original only then being labelled as abstract.

7
New cards

How do you interact with queues?

FIFO (First In First Out)

8
New cards

How does a linear queue function?

With use of 2 pointers:

  • Front Pointer

  • Rear Pointer

With these two it will add to the rear (being furthest right) and subtract from the front (being furthest left)

9
New cards

What happens if you reach the end of a linear queue?

CIRCULAR QUEUE!!! in a linear queue it’ll probably just say its full as the pointers always go to the first available space.

Considering a Circular Queue it has the power to go over the edge and loop back round like a circle so if there is space back at the beginning. it can be used.

<p>CIRCULAR QUEUE!!! in a linear queue it’ll probably just say its full as the pointers always go to the first available space.</p><p>Considering a Circular Queue it has the power to go over the edge and loop back round like a circle so if there is space back at the beginning. it can be used.</p>
10
New cards

How does a priority queue work?

Quite similar to that of a weighted graph. Everything is labelled with a value defining its importance in turn saying when it should be dealt with and if there are two of the same variant then simply they are treated as if its a regular queue. (FIFO)

11
New cards

How do you interact with stacks?

FILO (First In Last Out)

12
New cards

How do Stacks work?

Stacks work with a singular pointer known as the top pointer. (Like a stack of books)

13
New cards

What operations can be done on a stack?

  • Push — Adds an item to the stack

  • Pop — Removes an item from the stack

  • Peek — returns the value on top (No Removal)

IsFull , IsEmpty both work.

14
New cards

What are the parts of a graph called?

  • Nodes or Vertices

Get joined together by

  • Edges or Arcs

A Weighted graph has values assigned to these edges.

15
New cards

Instead of using a graph to present what else could be used?

An Adjacency list which displays all the relationships in a different way.

<p>An Adjacency list which displays all the relationships in a different way.</p>
16
New cards

What is the difference between Adjacency Matrix and List?

Adjacency Matrixes store every possible edge there is even if they dont exist with the downside being it takes up more storage while the lists only look at the edges which exist and in turn take up less storage.

  • Adjacency Matrix is better for Dense Graphs

  • Adjacency List is better for Sparse Graphs

17
New cards

What are the 3 rules for trees?

  • Must be Connected

  • Must be an undirected graph

  • must have no cycles.

18
New cards

What makes a root node?

The Root Node is the first node at the top of a tree diagram. These trees contain parents and children.

To be a Root Node you must have no parents.

19
New cards

What is the difference between Trees and Binary Trees?

A Binary tree has no more that 2 children under a single parent.

20
New cards

What do Hash Tables do?

Hash Tables are a way of storing data that allows for it to be retrieved within a constant time complexity.

21
New cards

How do Hash Tables work?

Hash tables take a value and then hash the value masking it with something else and then never again reveal the original input and continue to use the hashed value instead.

22
New cards

How does Dictionary work?

Exactly like it works for compression when a specialized dictionary gets made in order to use duplicates and save entire phrases.

23
New cards

What is the difference between Static and Dynamic?

Static in regard to Data Structures mentions that they are set and final when it comes to questioning the amount of space or rather data they can hold while for dynamic they are able to change their size willingly.

24
New cards

What does sequential mean?

Sequential looks at order stating that one comes after the other.

25
New cards

What is it called if there happens to be too much data in a single structure?

A stack overflow. (An Overflow error)

26
New cards

What does Push do?

Push adds an item to a stack.

27
New cards

What does Pop do?

Pop removes an item from a stack.

28
New cards

What does Peek do?

Without removing anything it will check the top value.

29
New cards

How many pointers does a stack have?

1 — The Top Pointer

30
New cards

How many pointers do queues have?

2 — The Front and Rear Pointers