Data Structures and Algorithms 1 MCQ

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/17

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

18 Terms

1
New cards

Algoritm is

Description of how to solve a problem.

2
New cards

Algorithms should also be

Unambiguous

3
New cards

Pseudocode is

Meant only to be read by humans.

4
New cards

The purpose of pseudocode is

Present an algorithmic operational principle.

5
New cards

Using decrease and conquer - design strategy

one takes a suitable part of the programs, which will be solved. This will be repeated, until the whole problem is solved.

6
New cards

Insertion sort sorts items

By looking for a placement for each item, one by one, by moving already ordered items.

7
New cards

With large datasets insertion sort is

Becomes very inefficient.

8
New cards

When one start to implement an algorithm, it is important to

  1. Think what would be the most reasonable way to implement it using the programming language at hand.

    2. Perform input validation and take care of error handling.

9
New cards

What do we actually measure when measuring an algorithm’s efficiency?

The number of executed operations.

10
New cards

Sharing the data wisely helps (you can pick several)

In the upkeep of the data
To prevent unnecessary waste of storage
To speed up the program

11
New cards

Recursion is especially useful in this course, because

It is easy to solve big problems, which contain similar smaller problems.

12
New cards

“In divide and conquer - design principle, the problem is…

divided into sub-problems, until it is trivial to solve, after which the partial solutions are collected as the final solution.

13
New cards

What types of problems are suited well for “divide and conquer” - design principle?

Recursive and hierarchical

14
New cards

Quicksort starts by


selection one item to be a “pivot”-item.

15
New cards

after selecting one item to be a “pivot”-item, the items are

sorted (partitioned) into two parts: the smaller or the larger than pivot items.

16
New cards

Then items on both sides of the pivot are

Sent as a parameter to a recursive call to quicksort.

17
New cards

(Sent as a parameter to a recursive call to quicksort.) This will be repeated, until

There are so few items left that they are already in the right order.

18
New cards

The idea behind partitioning is


To divide the items into to sub-sets for which the items in the first sub-set fulfil the given condition.

Explore top flashcards

Real poop v2
Updated 394d ago
flashcards Flashcards (63)
BOH4M - Unit 1 Test
Updated 280d ago
flashcards Flashcards (54)
Brain Bee
Updated 1037d ago
flashcards Flashcards (177)
unit 6
Updated 288d ago
flashcards Flashcards (36)
Real poop v2
Updated 394d ago
flashcards Flashcards (63)
BOH4M - Unit 1 Test
Updated 280d ago
flashcards Flashcards (54)
Brain Bee
Updated 1037d ago
flashcards Flashcards (177)
unit 6
Updated 288d ago
flashcards Flashcards (36)