Week 1 - Introduction and Binary Search and Big O Flashcards

1
Q

What is an Algorithm?

A

An algorithm is a specific set of instructions designed to perform a particular task. Algorithms are fundamentals coding elements; they define the steps a program must take to solve a problem or achieve a goal

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

What is a Data Structure?

A

A data structure is a particular way of organizing and storing data. Efficient data management relies on appropriate data structures for each task or application.

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

What are the areas in software development where algorithms are used?

A
  1. Data Processing
  2. Machine Learning
  3. Cryptography
  4. Graph Theory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the names of 7 Data Structures?

A
  1. Array
  2. Linked List
  3. Queue
  4. Stack
  5. Hashtable
  6. Tree
  7. Graph
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the naive approach for searching a list for a specific element? (Brute force/ Simple Search)

A

The naive approach is to check each element in the list one by one until the target is found or the list ends. It is O(n) linear time in the worst case.

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

What is a Search Problem?

A

A Search Problem involves finding a specific item or value within a collection of data.

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

What is the Binary Search algorithm?

A

The binary search algorithm finds a target’s position in a sorted list by repeatedly halving the search range until the target is found or the search space is exhausted. If found, it returns the index; otherwise, it returns None. (Only works with sorted data!)

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

What are the differences between binary search and simple search?

A

Simple search is much simpler than binary search, but binary search is much more effective for larger amounts of data.

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

What is the order of time complexities in Big O notation, from fastest to slowest?

A
  1. O(log n) –> Logarithmic Time
  2. O(n) –> Linear Time
  3. O(nlog n) –> Log-Linear Time
  4. O(n^2) –> Quadratic Time
  5. O(n!) –> Factorial Time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does Big-O notation show?

A

Big-O notation shows how an algorithm’s running time increases as the input size increases. It is used to compare algorithms. It does not indicate time in seconds, but rather “worst-case run time”.

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