Intro Flashcards

1
Q

What are data structures?

A

Data structures are systematic methods of storing and organising data so it can be used efficiently.

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

What is an algorithm?

A

An algorithm is a step by step procedure detailing a series of instructions to follow in order to accomplish a task.

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

What are the characteristics of algorithms?

A
  1. Unambiguous
  2. Must have well defined inputs
  3. Must have at least one output
  4. Must be language independent
  5. Must be easy to understand
  6. Must be generic; can be used for multiple input types
  7. Must have finite steps
  8. Must be feasible
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the various operations on data structure?

A
  1. Sorting
  2. Traversing
  3. Deleting
  4. Updating/ Inserting
  5. Searching
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an interface?

A

It is the set of operations that can be performed on a data structure.

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

What is implementation?

A

It is the internal representation of a data structure, which includes the algorithm of the data structure’s operations.

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

What are the execution time cases?

A
  1. Worst Case
  2. Average Case
  3. Best Case
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are Elementary items?

A

Data values that cannot be further simplified or broken down.

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

What is an entity?

A

An item that has a list of attributes.

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

Based on steps how can algorithms be classified?

A
  1. Sequential steps: steps that must be executed in the order they are defined/outlined.
  2. Selective steps: these steps include conditionals which allows for the selection of steps best suited for the problem.
  3. Iterative steps: have to be repeated a number of times to accomplish task
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the characteristics of data structures?

A
  1. Correctness
  2. Time complexity
  3. Space complexity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why do we need data structures?

A
  1. To search through large files with ease
  2. To improve processing speed
  3. To handle multiple requests
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

When is a function said to be a Big O notation?

A

When,
f(n) ≤ c • g(n) for all n ≥ no

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

What are the types of algorithm analysis?

A
  1. A priori or Asymptotic analysis (before implementation; theoretical analysis)
  2. A posteriori (after implementation; practical analysis)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is pseudocode?

A

High level program representation of an algorithm.

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

What are the types of asymptotic analysis?

A
  1. Best case (uses Omega notation)
  2. Average Case (uses Theta notation)
  3. Worst case (uses Big O notation)
17
Q

Relate Big O, Omega, and Theta notations with their bounds with respect to tim

A

Big O deals with upper bound
Omega deals with lower bound
Theta deals with the moment both upper and lower bounds are equal.

18
Q

What is the formula for row-major order?

A

Address (A[I][j]) = Base address + storage size × (i × num of columns + j)

Remember BODMAS.

19
Q

What is the formula for column-major order:

A

Address (A[i][j]) = base address + storage size × ( j × num of rows + i)

20
Q

What are the components of a graph?

A
  • data elements are called vertices
  • Connections are called edges
  • Vertices have more than one parents/relationship with other vertices
21
Q

Dynamic Vs. Static Data Structures

A

Dynamic data structures do not have fixed memory spaces for elements but static data structures do.

22
Q

Non-linear vs. Linear data structures

A

Non-linear data structures: data is not stored sequentially.

Linear data structures: data is stored sequentially/linearly

23
Q

Characteristics of a tree

A
  • Hierarchical and non-linear
  • The beginning point is called the root.
  • Data items are called nodes
  • Has branches
24
Q

Qualities of queues.

A
  • First In First Out (FIFO) principle.
  • Data files are added in one end called the rear and removed from another called the front.
25
Q

Stacks properties.

A
  • Operates on a Last In First Out (LIFO) principle.
26
Q

What are linked lists?

A

Data structures where each data item holds both data and pointers to the next data item in the list.

27
Q

Types of arrays

A
  • One dimensional: has only one row.
  • Two dimensional: has more than one row and column
  • Multi-dimensional: array of arrays.