week 3 test

docx

School

University of Phoenix *

*We aren’t endorsed by this school

Course

310

Subject

Computer Science

Date

Feb 20, 2024

Type

docx

Pages

7

Uploaded by AgentCranePerson1078

Report
| What will be the output of the following code? I What will be the output of the following code? A=, 4,6 B=11,2 3, 4 print(A - B) print(A A B ‘o
) I What will be the output of the follow Abe = {1,2,4} abe = {1,2,4,5,6} Abc = "Abc" print(Abe < abe) d print(Abe == abc) W What will be the output of the following code? A=1{1,2,4 B = {1,2,4,5,6,7} print(A <= B) print(A >= B)
v Correct colors = [‘red' sorted(colors) 'green', 'blue', 'cyan', 'magenta’, 'yellow'] print (colors) 'green', 'blue', 'cyan', 'magenta’, green magenta', 'red', 'yellow' 'blue', 'cyan', 'green', 'magenta’, 'yvellow', 'magenta', 'green', 'cyan', 'blue', 'red'] l What will be the output of the following code? colors = ['red', 'green', 'blue', 'cyan', 'magenta', 'yellow'] colors.sort print (colors What will be the output of the following code? A = {'Red", 'Yellow', 'Orange'} B = {'Red", 'Green', 'Blue'} print(A. isdisjoint (B)) print(A 1= B lisjoint(B)) operation performs B an c ns betwee elements. The (A != B) operation performs Boolean comparisons between Hence, the first print statement will print False and second will print True.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
v Correct v Lorrect quer paradigm? v Correct implementation? v Correct EUEEL AR opriate to sort 1 GB of data with only 100 MB of available main memory? Correct | Suppose you are sorting an array of eight integers using quick-sort, and you have just finished the first partitioning with the array looking like this: Which statement is correct?
Correct in a complete binary tre ) | What s the time complexity of the merge-sort algorithm in the worst case? 0 - v Correct
v Correct v Lorrea nstant number of re: v Lorrect
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
v Correct Explanation