DCSN04C midterms Flashcards

1
Q

is used to rearrange a given array or list of elements according to a comparison operator on the elements. The comparison operator is used to decide the new order of elements in the respective data structure.

A

Sorting Algorithm

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

refers to rearrangement of a given array or list of elements according to a comparison operator on the elements. The comparison operator is used to decide the new order of elements in the respective data structure.

A

Sorting

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

uses constant space for producing the output (modifies the given array only) or copying elements to a temporary storage.

A

In-place Sorting

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

is when all the data is placed in the main memory or internal memory.

A

Internal Sorting

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

is when all the data that needs to be sorted cannot be placed in memory at a time, the sorting is

A

External Sorting

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

When two same items appear in the same order in sorted data as in the original array called

A

Stable sorting

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

When two same data appear in the different order in sorted data it is called

A

Unstable sorting

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

a measure of how long it takes to run an algorithm, is used to categorize sorting algorithms.

A

Time Complexity

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

This is the amount of extra space (apart from input array) needed to sort.

A

Auxiliary Space

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

A sorting algorithm is said to be stable if the relative order of equal elements is preserved after sorting.

A

Stability

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

is one that does not require additional memory to sort the data.

A

In-Place Sorting

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

is one that takes advantage of pre-existing order in the data to improve performance.

A

Adaptive sorting

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

Sorting is often a crucial step in search algorithms like binary search and Ternary Search.

A

Searching Algorithms

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

Sorting data makes it easier to search, retrieve, and analyze.

A

Data management

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

Sorting data in databases improves query performance

A

Database optimization

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

Sorting is used to prepare data for training machine learning models.

A

Machine learning

17
Q

Sorting helps in identifying patterns, trends, and outliers in datasets.

A

Data Analysis

18
Q

Sorting algorithms are used in operating systems for tasks like task scheduling, memory management, and file system organization.

A

Operating Systems

19
Q

is a simple and efficient sorting algorithm that works by repeatedly selecting the smallest (or largest) element from the unsorted portion of the list and moving it to the sorted portion of the list.

A

Selection sort

20
Q

is one of the most popular sorting algorithms that is based on the principle of Divide and Conquer Algorithm.

A

Merge Sort

21
Q

Given a list, take the current element and insert it at the appropriate position of the list, adjusting the list every time you insert. It is similar to arranging the cards in a Card game.

A

Insertion Sort

22
Q

is a fundamental concept in computer science used for storing and managing data in a specific order. It follows the principle of “First in, First out” (FIFO), where the first element added to the queue is the first one to be removed.

A

Queue Data Structure

23
Q

A queue is a linear data structure that follows the _____ principle. It operates like a line where elements are added at one end (rear) and removed from the other end (front).

A

First-In-First-Out (FIFO)

24
Q

Adds an element to the rear of the queue.

A

Enqueue (Insert)

25
Q

Removes and returns the element from the front of the queue.

A

Dequeue (Delete)

26
Q

Returns the element at the front of the queue without removing it.

A

Peek

27
Q

Checks if the queue is empty.

A

Empty

28
Q

Checks if the queue is full.

A

Full

29
Q

we iterate over all the elements of the array and check if it the current element is equal to the target element.

A

Sequential Search/Linear Search

30
Q

is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order. This algorithm is not suitable for large data sets as its average and worst-case time complexity are quite high.

A

Bubble Sort

31
Q

is a simple sorting algorithm that works by iteratively inserting each element of an unsorted list into its correct position in a sorted portion of the list. It is like sorting playing cards in your hands. You split the cards into two groups: the sorted cards and the unsorted cards. Then, you pick a card from the unsorted group and put it in the right place in the sorted group.

A

Insertion sort

32
Q

is a sorting algorithm that follows the divide-and-conquer approach. It works by recursively dividing the input array into smaller subarrays and sorting those subarrays then merging them back together to obtain the sorted array.

A

Merge sort

33
Q

is a comparison-based sorting algorithm. It sorts an array by repeatedly selecting the smallest (or largest) element from the unsorted portion and swapping it with the first unsorted element. This process continues until the entire array is sorted.

A

Selection Sort

34
Q

is a comparison-based sorting algorithm. It sorts an array by repeatedly selecting the smallest (or largest) element from the unsorted portion and swapping it with the first unsorted element. This process continues until the entire array is sorted.

A

Selection Sort