Ace - AI Tutor
Ask Our Educators
Textbooks
My Library
Flashcards
Scribe - AI Notes
Notes & Exams
Download App
Briana Brown

Briana B.

Divider

Questions asked

INSTANT ANSWER

What is the time complexity of the following: let 1000 < n > 0 essments let a = 0 for (int i = 0; i < n; ++i) { 4.2 Types of variables I (11) for (int j = n; j > 0; --j) { int a = 0; a = a + i + j; Console.WriteLine(i + " " + j);

View Answer
divider
INSTANT ANSWER

let \( 1000<n>0 \) let \( a=0 \) for (int \( 1=0 ; i<n ;++i) \) \{ for (int \( j=n ; j>0 ; \cdots j \) ) i int \( a=\theta \); \( a=a+i+j ; \) Console.WriteLine \( (i+\cdots+j) \); \} ?

View Answer
divider
INSTANT ANSWER

Select the correct response: \( y=1 / 2 x-3 \) \( y=5 x-3 \) quiz_assignment/start/12395353\#

View Answer
divider
INSTANT ANSWER

Two separate computers are used to sort 10,000,000 (10^7) integers. Computer A executes 10,000,000,000 (10^10) instructions per second, whereas Computer B only performs at 10,000,000 (10^7) instructions per second (i.e., A is 1000 times faster than B). Additionally, Computer A uses an insertion sort taking only 2-n^2 instructions, whereas Computer B uses an implementation of merge sort taking 50-n-log(n) instructions (n being the number of integers to sort) Calculate the time it takes for each computer to sort (10^7) integers using the following equation: Time (in seconds) = instructions / instructions per second 1 Progra Which computer sorts the fastest?

View Answer
divider
INSTANT ANSWER

Assume that strings contain an array of characters, and that strings can be accessed like arrays to reach each character. Assume that Console Write does not write an end-of-line character. What will the following code display? There are no syntax errors in this code. string greeting = "Ready, Set, Bake!", for (int i = 0; i < 12; i++) Console.Write(greeting[i+2]);

View Answer
divider
INSTANT ANSWER

What is true about the following function: int sum(int.n){ int total = 0; for(int i = 1; i <= n; i++) total += i; return total;

View Answer
divider
INSTANT ANSWER

Which of the following loops (if any) display numbers 2 through & (inclusive)? Assume that Console. Write outputs information to a console window without a newline character. // A for (int i = 0; i <= 5; i++) Console Write(i + * "); a I B for (int i = 1; i < 9: i++) Console.Write((i+1) + " *); // C for (int i = 8; i >= 1; -i) Console.Write(2-i+1) + * *); //D for (int i = -6; i <= 10; i+=2) Console Write (/2+1) + **);

View Answer
divider
ANSWERED

Donna Densmore verified

Numerade educator

is a number type that is a member of the set of discrete positive integers.

View Answer
divider
INSTANT ANSWER

You have the following stack of items: [0,10,6,5,9,2] and proceed with the following steps: 1) Add/push a new number: 12 2) Add/push another number: 6 3) You remove/pop a number. What is the resulting stack of items?

View Answer
divider
INSTANT ANSWER

A greedy algorithm pursues local optima, in hopes of finding a globally optimal solution Example: Given a currency with coin values of { 1, 3, 6, 12}, produce change for 23 cents using the least number of coins possible. Algorithm: Coins with the max allowable value at each step are chosen. Answer: 12 + 6 + 3 + 1+1. Consider a currency with coin values of { 1, 5, 8 When the same greedy algorithm is applied to produce change for 10 cents, does it optimal solution (least number of coins?

View Answer
divider