Question

1-3 2 points) Which graphical object will be shown in foreground on the canvas? rec = Rectangle (150, canvas.add (rec) sqr = square (100) canvas.add (sqr) rec.setDepth (50) sqr.setDepth (50) 75) (1) Rectangle (2) Square (3) Canvas (4) Circle (2 points) 1-4 (2 points) What happens if you dont call the close0 method after writing data to a file? (1) The file will not be created (2) The file will be deleted (3) The file contents may be incomplete. (4) The file name wil1 be changed (2 points) 1-5 (2 points) Why is the merge sort algorithm is faster than the straight sort algorithm? (1) Because the merge sort can be implemented as a recursive function (2) Because the merge sort requires a less number of comparisons between elements. (3) Because the size of the merge sort program is smaller (4) Because the complexity of the merge sort is (n-1)2 (2 points)

Can you please explain when you pick the correct answer of these questions, briefly as to why the answer was picked. Thankyou.

Language used here is python 3

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Please Note:
As per Chegg Answering Guidelines, I have answered the first question. Please Re-post for the other Questions.

Q1.Answer)
The graphical object which will be shown in the foreground of the canvas will be:
2) Square

The square will be shown in the background as it will be added last and will be on top of the Rectangle.

Add a comment
Know the answer?
Add Answer to:
Can you please explain when you pick the correct answer of these questions, briefly as to...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Explain how you get the answer please. Thank you 5. Find the time complexity, big-9 function, of the algorithm of finding the maximum element in a finite sequence. (Determine the number of compari...

    Explain how you get the answer please. Thank you 5. Find the time complexity, big-9 function, of the algorithm of finding the maximum element in a finite sequence. (Determine the number of comparisons.) (10 points) LGORITIMs Finding the Maximum Element in a Finite Sequence procedure maaistegers for 2 to " return maxf max is the larpest eleet 5. Find the time complexity, big-9 function, of the algorithm of finding the maximum element in a finite sequence. (Determine the number of...

  • I want just the answer to the third task. to generate a report/graph. Thanks! 1 Problem...

    I want just the answer to the third task. to generate a report/graph. Thanks! 1 Problem Description Instructions. You are provided the skeleton code named Sort.java. The source file is available on Canvas in a folder named HW1. Please modify the skeleton code to solve the following tasks. . Task 1 (80 pts). Implement the Insertion Sort algorithm as discussed in Lecture 1. (Hint: use the function checked sorted to check if your output is indeed sorted.) . Task 3...

  • Answer in python 3 and can you please include a screenshot of the code and the...

    Answer in python 3 and can you please include a screenshot of the code and the output Problem 4 (Quicksort) For this problem you must implement the recursive quicksort algorithm covered in lecture to sort points based on their distance from the point (0, 0). Crete a Python file called quicksort.py and implement a function called quicksort(list) that does the following: COMP 1005/1405A – S19 – A5 Due Saturday, June 15th at 11:59 PM 3 1. Takes a 2D list...

  • please Type your answer! thanks ting a true false. You (1) Mark the following assertions about...

    please Type your answer! thanks ting a true false. You (1) Mark the following assertions about sorting at need to explain your answers. (a) (2 points) BubbleSort can be implemente time in N(n). Semented to have a better (b) (2 points) Selection Sort has a worst-case as a worst-case running time in Oslo (e) (2 points) The recursive version or benary search than the non-recursive version. (d) (2 points) The worst-case time complexity of NergeSortising ( a s ( points)...

  • Java We did in lecture, and explain your answer briefly. Problem 4: Sorting practice 14 points;...

    Java We did in lecture, and explain your answer briefly. Problem 4: Sorting practice 14 points; 2 points for each part individual-only Important: When answering these questions, make sure to apply the versions of these algorithms that were discussed in lecture. The Java code for each algorithm can be found in our Sort class. Given the following array: {14, 7, 27, 13, 24, 20, 10, 33 1. If the array were sorted using selection sort, what would the array look...

  • In C++ How do you demo that selection sort has O(N2) complexity? Meaning of the O(N2)....

    In C++ How do you demo that selection sort has O(N2) complexity? Meaning of the O(N2). If you have N=1000 input values the selection sort need roughly 1000000 steps. What is the meaning of thee ‘step’ here? One ALU comparison, one swapping of values, or one calculation step on one value of the array. What is the total number of steps for selection sort? Let me use an example N=5, to help me think 4+1-__ 3+1-__ 2+1-__ 1+1-__ F(N)=__________________________ This...

  • the question from the course COMP 4040 that Analysis of Algorithms if you want to answer it by code please use C or C++...

    the question from the course COMP 4040 that Analysis of Algorithms if you want to answer it by code please use C or C++ 5. Algorithm Design (20 points) Input: array A contains n distinct numbers from 1 to n, in arbitrary order. Output: number of inversions (defined as the number of pair(i, j) of array indices with i < j and A[i] > Aj]) (a) (5 points) What array with elements from the set {1, 2, ..., n) has...

  • A. What is the time complexity of Insertion Sort? B. Explain why Insertion Sort has the...

    A. What is the time complexity of Insertion Sort? B. Explain why Insertion Sort has the time complexity you listed above in Part A. C. Show the steps followed by the Quicksort algorithm given below in pseudocode when sorting the following array. Algorithm Quicksort (A, left, right) if (left < right) pivot Point + [(left+right)/2] // note central pivot it left - 1 j right + 1 do do iti + 1 while (i < A.size) and (A[i] = A[pivotPoint])...

  • pls write correct answers asap.... Note- You are athempting question 9 out of 10 Match the following: 1) Quick Sort A)...

    pls write correct answers asap.... Note- You are athempting question 9 out of 10 Match the following: 1) Quick Sort A) Divide and conquer programming 2) Task Scheduling B) Greedy programming 3) Merge Sort C) Dynamic programming 4) Prim's D) Not stable a) 1-B2-A 3-C4-D b) 1-D 2-C3-A 4-B c) 1-D 2-C 3-B 4-A d) 1-C 2-D 3-A 4-B Ansre Note - You are attermpring qpestion out of 10 Odd man out: e Topological sort Algorithm DFS Algorithm Binary search...

  • C++ programming please Write a program that will display random numbers in order from low to...

    C++ programming please Write a program that will display random numbers in order from low to high. 1. Declare an integer array of size 100. Ask the user how many numbers to work with (n). It can be less than 100. 2. Generate random numbers from 10 to 50. 3. Write the random numbers to an output file named random.dat. Close the file. 4. Open random.dat for input and read the data values into your array. Pass your array to...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT