CC4 Sorting & Queue Flashcards

1
Q

Given a list of data FIND the location of a particular value or report that value is not present​

A

Searching

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

A fundamental application for computers​

Done to make finding data (searching) faster​

A

Sorting

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

The data collection to be sorted is kept in the MAIN memory.

A

Internal Sorting

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

The sorting of data stored on secondary devices. Data is sorted in the main memory and written back to the SECONDARY DEVICE.

A

External Sorting

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

is the SIMPLEST iterative algorithm operates by comparing each item or element with the item next to it and swapping them if needed.

A

Bubble Sort

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

has achieved SLIGHTLY better performance and is efficient than bubble sort algorithm.

A

Selection Sort

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

Is a SIMPLE sorting algorithm that allows for efficient, in-place sorting of the array, one element at a time.

A

Insertion Sort

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

s a type of a DIVIDE AND CONQUER algorithm used to sort a given array; this means that the array is divided into halves and then further sub-divided till division can no longer take place.​

A

Merge Sort

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

when size of UNSORTED LIST or portion of array is small use INSERTION SORT, OTHERWISE USE

A

Hybrid Sorts

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

(T)

Language libraries often have sorting algorithms in them​

Java Arrays and Collections classes​

C++ Standard Template Library​

Python sort and sorted functions​

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

(T)

Many other sorting algorithms exist.

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

is a special type of LinkedList. It is a FIFO (First-in, First-out) data structure. That is, the first element to be added will be the first element to be removed, and so forth.

A

Queue

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

three main operations:

A

enqueue, dequeue, and peek.

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

a LIST-LIKE STRUCTURE that provides restricted access to its elements.

A

Queues

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

(T)

In Queue, however an insertion must happen at one end that we call rear or tail of the queue and any removal must happen at the other end called front or end of the queue

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

A LIST OR COLLECTION with the restriction that insertion can be performed at one end (rear) and deletion can be performed at the other end (front).​

A

Operations​

EnQueue(x)​

DeQueue()​

Front()​

IsEmpty​

17
Q

All member functions for both the array-based and linked queue implementations REQUIRE

A

Constant Time

18
Q

issues are the same as for the equivalent stack implementations. ​

A

Space Comparison

19
Q

(T)

Unlike the array-based stack implementation, there is no convenient way to store two queues in the same array, unless items are always transferred directly from one queue to the other.​

A