Mobile CSP Quarter 3 study guide

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Is the following problem tractable (solvable in a reasonable amount of time) or intractable (cannot be solved in a reasonable amount of time)? For any length string of letters using any combination of the letters 'a' through 'z', write down all possible strings.

Intractable

Q-5: When you send an e-mail message using Gmail in your browser or using the Gmail app __________________.

A. the Gmail server divides the message into packets that are routed individually over the Internet to the recipient's email

Q-8: Latency measures ___________________.

A. the amount of time it takes to send a message over the Internet

Which of the following code segments can replace <MISSING CODE> so that the program works as intended? Select two answers.

A.gradeList[i] ← gradeList[i] + 5IF (gradeList[i] > 100){ D.gradeList[i] ← min (gradeList[i] + 5, 100)

Consider an algorithm to solve a problem that takes 160 seconds to run on 1 processor. This algorithm can be divided among two processors to solve the same problem in 100 seconds. What is the speedup for this parallel algorithm?

1.6

A sorted list of numbers contains 500 elements. Which of the following is closest to the maximum number of list elements that will be examined when performing a binary search for a value in the list?

10

According to the following table, how many lookups would be required in the worst case to find a number in list of 10000 elements using linear search? Type your answer in the text box.

10000

In the bubble sort demo, 13 cards are being sorted. How many passes does this version of the algorithm require to sort the cards?

13

According to the following table, how many lookups would be required in the worst case to find a number in a sorted list of 10000 elements using binary search? Type your answer in the text box.

14

Suppose you are sorting the following list of numbers in ascending order using bubble sort: [16, 5, -1, 4, 12, 17, 3, 10, 5, 9]. After the first pass through the numbers, what value would appear on the right of the list?

17

If you were using binary search to find the number 14 in the following list [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], how many iterations would be required to find 14 in the list?

3

For a list of 500 numbers, at most how many iterations would the loop in binary search run to find a number? For example, if this was a guessing game, at most how many guesses would it take using binary search to guess a secret number from 1-500, if after each guess you were told whether your guess was too high or too low or just right? Type your answer into the text box.

9

Q-1: An IPv4 address ____________________. Choose all that apply.

A. is used to route data through the InternetB. is a string of bits that provides a computer's Internet address. D. consists of 32 bitsCheck MeCompare me

Q-4: A Caesar cipher is an example of a ______________________.

A. substitution cipher

Which of the following characteristics is true of bucket sort? Choose all that apply.

A linear algorithm . More efficient than bubble sort.

What shape would be drawn by this algorithm?

A pentagon with sides of length 100 pixels

Which of the following best approximates the minimum possible time to execute all three processes when the two processors are run in parallel?

A. 80 seconds

Which of the following characteristics is true of bubble sort? Choose all that apply.

A. A comparison-based algorithm. B. An N2 algorithm.

Q-2: IPv4 was designed to be scalable and change in size and scale to meet new demands. But IPv4 is limited to about 4 billion unique IP addresses. What is planned to fix this as the number of devises on the internet grows beyond this.

A. IPv4 is being replaced by IPv6 which can address many more devices.

Q-6: Which of the following are benefits of redundancy in routing on the Internet where there is more than one route for packets to travel through the Internet?

A. Increasing the ease with which the Internet can scale or grow where extra routes can be easily added.B. Increasing the fault-tolerance of the Internet so that packets will reach their destination even if some connections have failed.

Caesar cipher, simple substitution cipher, and Vigener cipher are all examples of __________ ciphers.

A. Substitution B. Symmetric

True or False: Cloud computing is made possible by the Internet and the World Wide Web and employs a computation model known as client-server computing.

A. True

Under which of the following conditions is it most beneficial to use a heuristic approach to solve a problem?

A. When the problem cannot be solved in a reasonable time and an approximate solution is acceptable.

What are the values in the list after executing the following code: list ← [ 0, 3, 5 ] APPEND( list, 4 ) INSERT( list, 2, 1 ) REMOVE( list, 1 )

A. [1, 3, 5, 4]

Q-5: According to the domain name system (DNS), which of the following is a subdomain of the domain example.com?

A. about.example.com

To say that bucket sort is more efficient than bubble sort means that _________________.

A. as the size of the list grows, bucket sort will be faster than bubble sort.

AP 2021 Sample Question: Which of the following school policies is most likely to have a positive impact on the digital divide?

B. A school provides a laptop or tablet computer to all students enrolled at the school.

What does the following code do?

B. Displays 4 which is the maximum (largest) value in the list.

Q-5: A phone is an example of a __________.

B. a. client

The Halting Problemis an example of

B. an undecidable problem.

Q-5: One technique that can be used to break a Caesar cipher is called _________________________.

B. frequency analysis

Q-7: Bandwidth measures ___________________.

B. the amount of data that can be sent in a fixed amount of time

Q-3: The Domain Name System __________________.

B. translates easy-to-remember domain names into IP addresses

For searching a sorted list, which search algorithm is the better choice?

Binary Search

There are 32 students standing in a classroom. Two different algorithms are given for findingthe average height of the students. Algorithm AStep 1: All students stand.Step 2: A randomly selected student writes his or her height on a card and is seated.Step 3: A randomly selected standing student adds his or her height to the value on the card,records the new value on the card, and is seated. The previous value on the card is erased.Step 4: Repeat step 3 until no students remain standing.Step 5: The sum on the card is divided by 32. The result is given to the teacher.Algorithm BStep 1: All students stand.Step 2: Each student is given a card. Each student writes his or her height on the card.Step 3: Standing students form random pairs at the same time. Each pair adds the numberswritten on their cards and writes the result on one student's card; the other student isseated. The previous value on the card is erased.Step 4: Repeat step 3 until one student remains standing.Step 5: The sum on the last student's card is divided by 32. The result is given to the teacher.Which of the following statements is true?

C. Both Algorithm A and Algorithm B always calculate the correct average.

AP 2021 Sample Question: Which of the following best explains how data is typically assembled in packets for transmission over the Internet?

C. Each packet contains data to be transmitted, along with metadata containing information used for routing the data.

A summer camp offers a morning session and an afternoon session. The list morningList contains the names of all children attending the morning session, and the list afternoonList contains the names of all children attending the afternoon session. Only children who attend both sessions eat lunch at the camp. The camp director wants to create lunchList, which will contain the names of children attending both sessions. The following code segment is intended to create lunchList, which is initially empty. It uses the procedure IsFound (list, name), which returns true if name is found in list and returns false otherwise. FOR EACH child IN morningList { <MISSING CODE> } Which of the following could replace <MISSING CODE> so that the code segment works as intended?

C. IF (IsFound (afternoonList, child)) {APPEND (lunchList, child)}

Which of the following responses about the Learning App would earn a point for Row 3 of the scoring guidelines (managing complexity)?

C. The ButtonItems list manages the complexity of my program since it gives a set of numbers the text-to-speech can say that can be sorted or ordered randomly, and easily changed if I wanted to expand the app to include a language other than French. Without this list the program would need to individually call the numbers and set them in a random order manually, which would be more difficult than using a list where the values can be easily called by the program and ordered randomly by selecting a random list item; likewise, I'd have to manually go into the procedures that start the game and other rounds without a list and adjust the values individually to expand the program.

Q-2: A cipher is _________________________.

C. an algorithm that is used to scramble text so that it can be passed in secret

Which code below could be placed in the following loop to print out the item in a list that has the lowest (minimum) value? list ← [1, 0, 4, 2] x ← 99 FOR EACH item IN list { <MISSING CODE> } DISPLAY(x)

D. IF (item < x) x ← item

Q-4: Which of the following entities is responsible for creating and assigning IP addresses as new users join a network?

D. The Network Service Provider

A polyalphabetic cipher is one that ______________.

D. Uses multiple alphabets

Encrypt the word alphabet using a Caesar cipher with a shift of 3. Type your answer into the Textbox.

DOSKDEHW

: True or False: The following response about the Learning App earns a point for Row 6 of the scoring guidelines (testing)?

False

Q-4: True or False: An algorithm can be found for any computational problem whatsoever.

False

Q-6: True or false: All intractable problems (that cannot be solved in a reasonable time) are bad.

False

True or False: All routes on the internet are specified in advance and not set dynamically. For every packet of data sent over the Internet, there is only one route it can take to reach its destination.

False

True or False: The main difference between circuit switching and packet switching is that in circuit switching data is broken up and sent in parts and in packet switching data is sent out on a continuous circuit.

False

For searching an unordered list, which search algorithm is the better choice?

Linear search

For which of the problems would the binary search algorithm be useful? Choose all that apply.

Looking up a phone number in the phone book given the person's full (unique) name. Looking up a word in a Webster's dictionary.

For which of the problems could the linear search algorithm be used? Choose all that apply.

Looking up a phone number in the phone book given the person's full (unique) name. Looking up a word in a Webster's dictionary. Looking up a person's name in the phone book given the person's phone number. Guessing a secret number between 1 and 100.

The figure below shows a robot in a grid of squares. The robot is represented as a triangle, which is initially facing upward. The robot can move into a white or gray square but cannot move into a black region. Consider the procedure MoveAndTurn below.Which of the following code segments will move the robot to the gray square?

Move and turn 2, 1 move and turn 4,3 move and turn 2,0

or which of the problems would the bubble sort algorithm provide an appropriate solution. Choose all that apply.

Sorting a stack of paper money into denominations -- i.e., $1, $5, $10 etc. Arranging a deck of cards from the lowest to the highest value cards. Arranging books on a bookshelf by author's last name.Check MeCompare me

Find the bug. When Button1 is clicked, Label1 is supposed to be set to a name that is selectedfrom the names list by the displayName procedure. But the label's Text never changes. Why?

The displayName procedure is not being called when the button is clicked.

The following blocks specify what happens when the user clicks "Next" in a quiz app:There is a subtle error in the code such that the quiz won't work as desired. What is the problem?

The last question in the quiz will never be reached.

You should be able to draw a square of any size with this procedure by calling it and specifying the parameter L. However, this procedure has a bug. What is the bug?

The procedure always draws a square with sides of size 50. The parameter L is ignored,

Q-2: True or False: The following response about the Learning App earns a point for Row 3 of the scoring guidelines (managing complexity)?

True

Suppose you are sorting the following list of words in alphabetical order using bubble sort: [apple, banana, lemon, tomato, orange, squash, papaya, pumpkin]. Which of the following gives the correct order of the list after two passes through the list?

[apple, banana, lemon, orange, papaya, pumpkin, squash, tomato]

Suppose that the following word, EAIWSQI, was encrypted with a Caesar cipher and when you do a frequency analysis you learn that the most frequent letter was 'i'. What is the secret word? Type your answer into the Textbox. (Make sure there are no extra spaces in your answer.)

awesome

The function shown in this graph is known as the base-2 logarithm function, y = log2(x). Which search algorithm behaves like this function?

binary search

The following word was encrypted using a Caesar cipher with a shift of 2: ecguct. What word is it? Type your answer into the text box.

caesar

In talking about sorting algorithms in general, a sort algorithm's efficiency refers to ______________________.

how long it takes to arrange the values in order.

Q-6: Google's search engine is an example of a __________.

server

The key exchange problem is ____

the problem of securely sharing a symmetric key between Alice and Bob.

Suppose you are sorting the following list of words into alphabetical order using bubble sort: [apple, orange, banana, papaya, lemon, pumpkin, squash, tomato]. After the first pass through the list, what word would appear on the right of the list?

tomato


Set pelajaran terkait

Next Step Full Length Missed Questions

View Set

EOC12: End of Chapter Problems - Ch. 12: Perfect Competition and the Supply Curve

View Set

Chapter 15 The Four Phases of the Thirty Years War

View Set

GOVT 2305 - Chapter 11 - Congress - The Struggle for Democracy

View Set

AP Chemistry: Units 1-4 MCQ Practice

View Set

History of Missions // Missiological Issues of the 1st Expansion

View Set

ATI Tissue Integrity Assessment

View Set