data structures B and C

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/19

encourage image

There's no tags or description

Looks like no tags are added yet.

20 Terms

1
New cards

What is an abstract data type?

Logical description of a data structure that specifies its operations but not how its implemented

2
New cards

What is the mnemonic for a stack?

LIFO (Last in, First out)

3
New cards

What does push(item) do for stacks?

Adds item tk the top of the stack

4
New cards

What does pop() do for stacks?

Removes item from the top of stack

5
New cards

What does peek() or Top() do for stacks?

Looks at top item without removing

6
New cards

What does Is Empty() do for stacks?

Checks if the stack is empty

7
New cards

What does Is Full() do for stacks?

Checks if the stack is full

8
New cards

What is overflow?

Pushing an item onto a stack thats full

9
New cards

What is underflow?

Popping a stacj thats already empty

10
New cards

What is the mnemonic for queues?

FIFO (First in, First out)

11
New cards

What does enqueue(item) do for queues?

Adds an item to the rear if the queue

12
New cards

What does dequeue() do for queues?

Removes and returns the items at the front

13
New cards

What is an array based linked stack?

Stores in array using indexes. Starts with 0 then 1 then 2 etc

14
New cards

What is a linked stack?

Uses a linked list instead of a fixed array

15
New cards

What is an example of a dynamic data structure?

Tree,graph,list

16
New cards

What is an example of a static data structure?

Array

17
New cards

What is a graph?

A data structure that can be used to represent complex non linear relationships

18
New cards

Explain how Breadth-First Search works

Visits all neighbouring nodes before moving to the next level. It uses a queue (FIFO)

19
New cards

Explain how Depth-First Traversal works

Follows one paths as far as possible before backtracking. Uses a stack (LIFO) and it explores the graph deep into the branch. There are many possibilities for the path.

20
New cards

What is a binary search tree?

Each node can have a max of 2 children. The smaller values go left, the larger values go right. There doesnt have to be two children, can be one.