ياليت اللي يعرف طريقة حل هذا السؤال يقول لنا الطريقة والله يوفقنا بالاختبار
Q2. (0.5 points) Calculate the Big Oh performance for the following:
Given that an Array of size n=10 takes 3 seconds to search, how long does it take a search Array of
size n=100? (a)Linear Search of an array of size n=100 Given O(n)
(b) Merge Sort performance of an array is O(nlog(n)), given that an Array of size n=10 takes 3
seconds to sort,
how long does it take to sort an Array of size n=100?
ياليت اللي يعرف طريقة حل هذا السؤال يقول لنا الطريقة والله يوفقنا بالاختبار
q2. (0.5 points) calculate the big oh performance for the following:
Given that an array of size n=10 takes 3 seconds to search, how long does it take a search array of
size n=100? (a)linear search of an array of size n=100 given o(n)
(b) merge sort performance of an array is o(nlog(n)), given that an array of size n=10 takes 3
seconds to sort,
how long does it take to sort an array of size n=100?
هذا الحل ,,, بالتوفيق
التوقيع
( ينبغي أن نبسط كل شيء بقدر الإمكان، ولكن دون أن نفرط في تبسيطه )
"> Q4. (2 points) Write a program where you use Selection Sort to sort the following array in ascending order. 24,2,45,20,56,75,2,56,99,53,12 a) Declare an array of integers called unsortedarr and load it with the integers above. Notice we have 11 numbers, and the number 2 is repeated which is fine. Display the array as it is by printing it before the sort. b) Sort the array using the insertion sort technique and display the array after you sort it. Here is the beginning of the code, complete it, run it, test it, submit it. import java.util.*; public class MySelectSort ** public static void main(String[] args) ** int arr[] = **24,2,45,20,56,75,2,56,99,53,12**; System.out.println("-------------------------- - unsorted"); System.out.println(arr); // continue … write your code
هذا حل الكود الأخير بس ياليت يتم تغيير أسماء المتغيرات عشان الكل ياخذ درجة السؤال كامله
وبالتوفيق للجميع ....
الحل بالمرفقات
شكراااااااااااااا
طيب ممكن تحل لي هالسؤال ؟؟؟
1- Create two classes; The first called: StudentData, and the second called: CSStudents )
2- The classes are created to provide the structure for three objects of students st1, st2, and st2.
3- Class StudentData defines :
• Four of private attributes called (studentID, studentName, courseMark, numberOfHoursInCourse). These attributes have no initialization.
• Two of public attributes called (courseGradeNumberOfFive, courseGradeLetterOfFive). These attributes have no initialization.
• One Behavior called ( calculateGPA ): To calculate the point of the GPA of 5 for a provided course.
3- Class CSStudents defines :
• Three private attributes called (courseName, numberOfHoursInCourse, courseMark).
• Two public attributes called (courseGradeLetterOfFour, courseGradeNumberOfFour ).
• One Behavior called ( calculateGPA) To calculate the point of the GPA of 4 for a provided course, also it implements the function to calculate the Grade for the point of 5 and the point of 4 as well.
4- Show the ability of the constructor for overloading by using two constructors:
• One to initialize studentID, studentName.
• One to initialize studentID, studentName, courseName, courseMark, numberOfHoursInCourse
6- Show the advantage of the overriding in providing its specific implementation of calculateGPA method in class CSStudents , that is already provided by class StudentData.
7- Implement the three objects from the second class.
8- Display the structure for three objects from the main class to get as same as output below.
9- You may need more instance methods to complete your homework.
10- You may need more Overriding methods to complete your homework.
11- Provide your code and the implementation in Java code.
Q1. (0.5 point) (a)Write the java code for doing a Linear Search on the array given below. Write your code in the space below, (no need to submit .java file)
(b) What would your search method return if we asked to search for the number 2 and return it’s index position?
[24][2][45][20]56][75][2][56][99][53][12]
الي عنده الحل او طريقة الحل الله لايهينه ينزله التسليم اليوم بيقفل