CSP-Algorithm

CSP-Algorithm

University

17 Qs

quiz-placeholder

Similar activities

So You Think You Know Code?

So You Think You Know Code?

6th Grade - University

17 Qs

Computer Graphics

Computer Graphics

University

20 Qs

Time and Space Complexity

Time and Space Complexity

University

15 Qs

Technical vocab

Technical vocab

9th Grade - Professional Development

20 Qs

Data Structures- Introduction

Data Structures- Introduction

University

20 Qs

Soft Computing Quiz-1

Soft Computing Quiz-1

University

12 Qs

Exploring Software and Networks

Exploring Software and Networks

8th Grade - University

20 Qs

CS201: Chapter 1

CS201: Chapter 1

University

12 Qs

CSP-Algorithm

CSP-Algorithm

Assessment

Quiz

Science, Computers

University

Medium

Created by

闕河正 闕河正

Used 3+ times

FREE Resource

17 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Algorithm 1 calculates the correct sum, but algorithm 2 does not.

Algorithm 2 calculates the correct sum, but algorithm 1 does not.

Both algorithms calculate the correct sum.

Neither algorithm calculates the correct sum.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

1/n

n^2

n

n^3

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A high school provides email addresses to freshman students. The email system typically assigns an email address in the format "firstname.lastname@coolschool.edu". However, if a student has the same name as a previous student, the system assigns them a different format.

In order to figure out whether an email address is already assigned, the system does a binary search through its list of existing email addresses.

Which of these statements is true?

The list of email addresses must be sorted for binary search to work.

In the worst case that the email address is not in the list, binary search will need to look at every item in the list.

The code for the binary search algorithm must be written in binary to achieve optimum efficiency.

The list of email addresses don't need to be sorted for binary search to work, but that would improve the efficiency of the algorithm.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Ryland is creating an article about commonly used compression algorithms for an online educational site.

He's debating whether to express each algorithm in natural language, flow charts, pseudocode, or C++, a general-purpose programming language.

Which of these is a good argument for expressing the algorithm in pseudocode?

Pseudocode can express more detail than natural language, flow charts, and C++.

Pseudocode doesn't depend on the syntax and subtleties of a particular programming language, so his readers will be able to understand it as long as they know at least one language.

Pseudocode can be understood by anyone, even those without any programming experience.

Pseudocode can run on any computer, so all his readers will be able to run the algorithm themselves.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

1900 false

1984 true

2000 false

2002 false

1900 true

1984 true

2000 false

2002 false

1900 false

1984 true

2000 true

2002 false

1900 true

1984 true

2000 true

2002 false

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

解決同一個問題有a,b,c,d四個程式能做到,其時間複雜度分別為

A.6n^2

B.6n

C.1/n

D.2^n

請依據效能由好到壞排序(假設n很大)

C > B > A > D

B>D>A>C

D>B>C>A

A>B>C>D

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Yes, that test case is sufficient proof that the procedure works as intended for all possible lists of numbers.

No, since the expected return value is not [1, 2, 3, 4] for that test case.

No, but the programmer can conclude that it always works when generating lists that are 4 numbers long.

No, they've only verified that it works for that test case. Additional analysis and reasoning is necessary.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?