100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSE 1321 Final Review UPDATED ACTUAL Questions and CORRECT Answers $9.99   Add to cart

Exam (elaborations)

CSE 1321 Final Review UPDATED ACTUAL Questions and CORRECT Answers

 3 views  0 purchase
  • Course
  • CSE 1321
  • Institution
  • CSE 1321

CSE 1321 Final Review UPDATED ACTUAL Questions and CORRECT Answers This algorithm works by selecting the smallest unsorted item in the list and then swapping it with the item in the next position to be filled. - CORRECT ANSWER- Selection This algorithm works using two sets. The sorted part ...

[Show more]

Preview 3 out of 17  pages

  • October 26, 2024
  • 17
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CSE 1321
  • CSE 1321
avatar-seller
MGRADES
CSE 1321 Final Review UPDATED
ACTUAL Questions and CORRECT
Answers
This algorithm works by selecting the smallest unsorted item in the list and then swapping it
with the item in the next position to be filled. - CORRECT ANSWER✔✔- Selection


This algorithm works using two sets. The sorted part is initially empty. We remove the entries
from the unsorted portion one at a time and insert them in the the sorted part. - CORRECT
ANSWER✔✔- Insertion


This search compares the target value with the middle element in the collection, then ignores
the half of the collection in which the target cannot exist. - CORRECT ANSWER✔✔-
Binary


Sorting a collection makes searching for a value faster. - CORRECT ANSWER✔✔- True,
using binary search


We can use this notation to analyze an algorithm's efficiency. - CORRECT ANSWER✔✔-
Big O


Of the algorithms that we have studied in this module, which is the most efficient in practice?
- CORRECT ANSWER✔✔- Insertion


If an algorithm is described as O(n^2), then the time to process is directly proportional to the
square of the size of the input data set. - CORRECT ANSWER✔✔- True


This algorithm works by comparing each item in the list with the item next to it, and
swapping them if required. This process repeats until the list is fully sorted. - CORRECT
ANSWER✔✔- Bubble


This search scans one item at a time, without jumping to any item. - CORRECT
ANSWER✔✔- Linear

,What does the following statement do?


Create array grades[10] - CORRECT ANSWER✔✔- Declares grades to be a reference to an
array


Creates an instance of an array of 10 values


Will allow valid indices in the range of 0 - 9


**All of these


In a language that uses static typing, we are limited to only values of only one data type in the
array. - CORRECT ANSWER✔✔- True


What do you call the number that is used to pinpoint a specific element within an array? -
CORRECT ANSWER✔✔- index or subscript



Array indexes always starts at what value? - CORRECT ANSWER✔✔- 0


What will be the value of x[3] after the following code has been executed?


Create array x [5]
y←0
FOR (i = 0, i < 5, i++)
x[i] ← y
y ← y + 10

ENDFOR - CORRECT ANSWER✔✔- x = [0,10,20,30,40]
x[3] is 30
Answer: 30

, What will be the results of the following code?


ARRAY_SIZE ← 5
Create array x [ARRAY_SIZE]
FOR (int i = 0, i < length of x, i++)
x[i] ← 10

ENDFOR - CORRECT ANSWER✔✔- All the values in the array are initialized to 10


What would be the results of the following code?


Create array1 ← [33, 88, 11, 44, 99, 55]
value ← array1[0]
FOR (int i = 0, i < length of array1, i++)
IF(array1[i] < value) THEN

value ← array1[i]ENDIFENDFOR - CORRECT ANSWER✔✔- Value contains the lowest
value in array1.


What would be the value of x[1] after the following code is executed?


Create array x [22, 33, 44]
CALL ARRAY_PROCESS with x
...
METHOD ARRAY_PROCESS(parameter [] a)
BEGIN
FOR (int i = 0, i < length of x, i++)
a[i] ←a[i] + 5
ENDFOR

END ARRAY_PROCESS - CORRECT ANSWER✔✔- 38


For the following code, what would be the value of str[2]?

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller MGRADES. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $9.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

79373 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$9.99
  • (0)
  Add to cart