Data Structures 6 Flashcards

1
Q

Binary Search tree

A

all left descendants < =n < all right descendents 8 / \ 4 10/ \ \2 6 20

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

Balanced Trees

A

AVL trees and red-black trees

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

Complete Binary Trees

A

“every level of the tree is fully filled, except for the last level. it has to be filled left to right “

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

Full Binary Tree

A

a binary tree where every node has zero or 2 children. It is the all or nothing binary tree

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

Perfect Binary Tree

A

It is both full and complete. 2k - 1 nodes where k is the height

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

In-Order Traversal

A

LDR -> Left, Visit Node, Right.

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

Pre-Order Traversal

A

DLR -> Visit Node, Left, Right

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

Post-Order Traversal

A

LRD -> Left, Right, Visit NOde

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

Array advantages

A

Simple and easy to use and access to elements is O(1)

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

Array disadvantages

A

fixed size, one block allocation, and complex position-based insertion

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

O(1) complexity for access

A

Array and dynamic arrays time complexity.

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

O(n) time complexity for accessing elements

A

lists

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

Main operations of lists

A

traversing, insert(), pop()

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

Main operations of stack

A

push(), int pop()

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

Auxiliary operations of stack

A

int top(), int size(), int empty(), isFull()

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

I want to balance symbols, tags, and fix symbols

A

stack applications

17
Q

Space complexity of stack

A

O(n)

18
Q

Time complexity of push, pop, and operation of stack

A

O(1)

19
Q

Why is the push implementation of a dynamic array and list Average O(1)

A

Every now and then we have to increase the size of a full array which involves an O(n) operation

20
Q

idempotent

A

doing the same operation multiple times and getting the same outcome. In terms of Restful services, I should do the same call on data, multiple times, and it will not change.

21
Q

GET request

A

It is idempotent, therefore, It should never be used to alter data. We would like to be able to do this over and over

22
Q

PUT request

A

It is idempotent, therefore, it should only be used to update data. If I update with the same information, the result will not change.

23
Q

POST request

A

It is not idempotent, therefore, it should be used to alter data in some form where if you did the same post request, the resulting set will be different.

24
Q

CRUD

A

Create, Read, Update, Delete

25
Q

One-Many or Many One ->

A

In objects, if one object can have many of another object.This can be done with a simple WHERE clause or a simple join if another column data is needed of some sort

26
Q

Many-Many

A

If Many objects can have many of another. An employee can be a part of many departments, while many departments can have many employees. This is normally done by an intermediate table.