Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Answer can also be NONE I know the Chegg policy but these are very simple questions that should take no more than 5 minutes to
Answer can also be "NONE"
I know the Chegg policy but these are very simple questions that should take no more than 5 minutes to solve. pls :)
1: Select the correct output of the Algorithm below on input: 3, -1, 2, 9, 36, -764 Algorithm Input: a, a. an, a sequence of numbers n, the length of the sequence x, a number Output: ?? while (x2 # ai and i n) i:= i + 1 End-while If (x* - a) Return( i) Return(-1) a. b. 3 C. d. 6 2: Select the correct description for the output of the Algorithm below Algorithm Input: a, a. an, a sequence of numbers n, the length of the sequence x, a number Output: ?? For i 1 to n -1 For j i + 1 to n If (a-a>0) Returm( "True") End-for End-for Return( "False) a. "True" if there are any two numbers in the list that are not equal to each other, and "False b. "True if there are any two consecutive numbers in the list that are not equal to each other and "False" otherwise c. "True" if there are any two numbers in the list that are equal to each other, and "False otherwise d. "True" if there are any two consecutive numbers in the list that are equal to each other, and False" otherwise Page 1 of S HW 3: How many times is the variable count updated inside the loop in the pseudocode fragment below? count 0 For i 1 to 3 For j-i+1 to 4 count :=count + (j-i) End-for End-for a. 0 b. 6 c. 10 d. 12Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started