introduction Flashcards

1
Q

What is a data structure?

A

a way of organising, storing and managing data to enable efficient access and modification

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

What are the key characteristics of an algorithm?

A

well-defined inputs/outputs, definiteness, finiteness, effectiveness, and correctness.

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

What is an Abstract Data Type?

A

A mathematical model for data structures defining possible operations but not their implementation.

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

What is the difference between an algorithm and a heuristic?

A

An algorithm is a precise set of steps to solve a problem, while a heuristic is a general rule of thumb used to find an approximate solution faster.

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

What are the three key properties of a good algorithm?

A

Correctness, Efficiency, and Readability.

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

Why is algorithm efficiency important?

A

Because inefficient algorithms may be too slow for large inputs, affecting scalability and performance.

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

What is an example of a problem best solved using a heuristic rather than an algorithm?

A

The Travelling Salesman Problem (TSP)—heuristics like Genetic Algorithms or Simulated Annealing provide fast approximate solutions.

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