My C949 | Explains Algorithms 29%

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/32

flashcard set

Earn XP

Description and Tags

My Version of C949 Study Guide Flashcards | Explains Algorithms

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

33 Terms

1
New cards

Finiteness

An algorithm must always have a finite number of steps before it ends. When the operation is finished, it must have a defined endpoint or output and not enter an endless loop.

2
New cards

Definiteness

An algorithm needs to have exact definitions for each step. Clear and straightforward directions ensure that every step is understood and can be taken easily.

3
New cards

Effectiveness

An algorithm’s stages must be sufficiently straightforward to be carried out in a finite time utilizing fundamental operations. With the resources at hand, every operation in the algorithm should be doable and practicable.

4
New cards

Generality

Rather than being limited to a single particular case, an algorithm should be able to solve a group of issues. It should offer a generic fix that manages a variety of inputs inside a predetermined range or domain.

5
New cards

Modularity

This feature was perfectly designed for the algorithm if you are given a problem and break it down into small-small modules or small-small steps, which is a basic definition of an algorithm.

6
New cards

Correctness

An algorithm's correctness is defined as when the given inputs produce the desired output, indicating that the algorithm was designed correctly. An algorithm's analysis has been completed correctly.

7
New cards

Maintainability

It means that the algorithm should be designed in a straightforward, structured way so that when you redefine the algorithm, no significant changes are made to the algorithm.

8
New cards

Functionality

It takes into account various logical steps to solve a real-world problem.

9
New cards

Robustness

Robustness refers to an algorithm's ability to define your problem clearly.

10
New cards

User-friendly

If the algorithm is difficult to understand, the designer will not explain it to the programmer.

11
New cards

Simplicity

If an algorithm is simple, it is simple to understand.

12
New cards

Extensibility

Your algorithm should be extensible if another algorithm designer or programmer wants to use it.

13
New cards

Brute Force Algorithm

A straightforward approach that exhaustively tries all possible solutions, suitable for small problem instances but may become impractical for larger ones due to its high time complexity.

14
New cards

Recursive Algorithm

A method that breaks a problem into smaller, similar subproblems and repeatedly applies itself to solve them until reaching a base case, making it effective for tasks with recursive structures.

15
New cards

Encryption Algorithm

Utilized to transform data into a secure, unreadable form using cryptographic techniques, ensuring confidentiality and privacy in digital communications and transactions.

16
New cards

Backtracking Algorithm

A trial-and-error technique used to explore potential solutions by undoing choices when they lead to an incorrect outcome, commonly employed in puzzles and optimization problems.

17
New cards

Searching Algorithm

Designed to find a specific target within a dataset, enabling efficient retrieval of information from sorted or unsorted collections.

18
New cards

Sorting Algorithm

Aimed at arranging elements in a specific order, like numerical or alphabetical, to enhance data organization and retrieval.

19
New cards

Hashing Algorithm

Converts data into a fixed-size hash value, enabling rapid data access and retrieval in hash tables, commonly used in databases and password storage.

20
New cards

Divide and Conquer Algorithm

Breaks a complex problem into smaller subproblems, solves them independently, and then combines their solutions to address the original problem effectively.

21
New cards

Greedy Algorithm

Makes locally optimal choices at each step in the hope of finding a global optimum, useful for optimization problems but may not always lead to the best solution.

22
New cards

Base Case

This is the condition under which the recursion stops. It represents the simplest instance of the problem, which can be solved directly without further recursion.

23
New cards

Recursive Case

This is the part of the algorithm that breaks the problem down into smaller instances of the same problem and then calls the algorithm recursively on these smaller instances.

24
New cards

Linear Search

  • a sequential search algorithm that checks each element in a list one by one until a match is found or the entire list has been searched. It is simple to implement but can be inefficient for large datasets since it has a time complexity of O(n).

  • It takes longer as the n data size increases.

Time Complexity: O(N) Linear

25
New cards

Binary Search

  • a more efficient searching algorithm that requires a sorted list as input. It works by repeatedly dividing the search space in half, comparing the middle element with the target value, and eliminating half of the remaining elements based on the comparison.

  • Much faster than Linear Search for large datasets.

Time Complexity: O(log n) Logarithmic

26
New cards

Bubble Sort

  • a simple sorting algorithm that repeatedly steps through the list, compares adjacent elements, and swaps them if they are in the wrong order.

  • While easy to understand and implement, it has a time complexity of O(n²), making it inefficient for large datasets.

  • The algorithm gets its name from the way smaller elements _____ to the top of the list with each iteration.

Time Complexity: O(n ² ) Quadratic

27
New cards

Selection Sort

  • a sorting algorithm that works by repeatedly finding the minimum element from the unsorted portion of the list and placing it at the beginning.

  • The algorithm maintains two subarrays: one that is sorted and one that is unsorted. Like Bubble Sort, Selection Sort has a time complexity of O(n²), but it generally performs better than Bubble Sort as it makes fewer swaps.

Time Complexity: O(n ² ) Quadratic

28
New cards

Insertion Sort

  • a sorting algorithm that builds the final sorted array one element at a time.

  • It works by taking elements from the unsorted part and inserting them into their correct position in the sorted part of the array.

  • While it also has a time complexity of O(n²), performs well on small datasets and is particularly efficient when dealing with arrays that are already partially sorted.

Time Complexity: O(n ² ) Quadratic

29
New cards

Merge Sort

  • A highly efficient divide-and-conquer sorting algorithm works by dividing the array into smaller subarrays, sorting them, and then merging them back together.

  • It consistently performs well with a time complexity of O(n log n), making it much faster than the simpler sorting algorithms for large datasets.

  • Although it requires additional memory space, it is stable and predictable, making it a popular choice for sorting linked lists and in situations requiring stable sorting.

Time Complexity: O(n log n) Linearithmic

30
New cards

Quick Sort

  • efficient divide-and-conquer sorting algorithm that works by selecting a 'pivot' element and partitioning the array around it, with smaller elements placed before the pivot and larger elements after it.

  • This process recursively applies to the sub-arrays until the entire array is sorted.

  • performs extremely well in practice due to its efficient cache usage, its worst-case time complexity is O(n²), though this can be mitigated with proper pivot selection strategies.

Time Complexity: O(n ² ) Quadratic

31
New cards

Bucket Sort

  • distribution-based sorting algorithm that works by distributing elements into a number of buckets, then sorting these buckets individually.

  • It assumes uniform distribution of the input data across buckets and performs well when this assumption holds true.

  • The algorithm has an average time complexity of O(n + k), where k is the number of ______

Time Complexity: O(n + k) Linear (where k is the number of buckets)

32
New cards

Heap Sort

  • comparison-based sorting algorithm that uses a binary heap data structure to sort elements.

  • It works by first building a max-heap from the input array, then repeatedly extracting the maximum element and rebuilding the heap until all elements are sorted.

  • While it has a consistent time complexity of O(n log n) and sorts in-place, it typically performs slower than Quick Sort in practice due to poor cache performance.

Time Complexity: O(n log n) Linearithmic

33
New cards

Shell Sort

  • Generalization of insertion sort with a gap sequence.

  • Sorts elements far apart and gradually reduces the gap.

  • Efficient for medium-sized datasets.

  • Time Complexity: Depends on the gap sequence; commonly O(n3/2).

Time Complexity: Gap sequence, insertion-like; O(n^3/2).