حل واجب M180 2017

استعرض الموضوع السابق استعرض الموضوع التالي اذهب الى الأسفل

حل واجب M180 2017

مُساهمة  whatsapp:00966541597560 في الخميس مارس 30, 2017 4:51 pm

1
M180: Data Structure and Algorithms in Java
Tutor-Marked Assignment (Spring 2016/2017)
Cut-Off Date:
Total Marks: 40
Contents
Warnings and Declaration………………………………………………………………………………..1
Question 1……………..……………………….………………………………………………………….2
Question 2 ………………..…………………………………………………………………………….….2
Question 3 ………….………..………………………………………………………………………….….2
Question 4 ………….…………..……………………………………………………………………….….3
Plagiarism Warning:
As per AOU rules and regulations, all students are required to submit their own TMA work and avoid plagiarism.
The AOU has implemented sophisticated techniques for plagiarism detection. You must provide all references
in case you use and quote another person's work in your TMA. You will be penalized for any act of plagiarism
as per the AOU's rules and regulations.
Declaration of No Plagiarism by Student (to be signed and submitted by student with TMA
work):
I hereby declare that this submitted TMA work is a result of my own efforts and I have not plagiarized
any other person's work. I have provided all references of information that I have used and quoted in
my TMA work.
Name of Student:………………………………..
Signature:…………………………………………...
Date:……………………………………………………
Arab Open University
2
Question 1: (8 marks)
Write the Java code of the method Mirror that takes one 2-dimentional array (squared
matrix) A1, and returns 2D array A2 which is the mirror image of A1.
For example, if A1 is as follows:
Then the method will return
Question 2:(12 marks)
Write a java method that will take two sorted stacks A and B (min on top), and return one
stack D that is sorted (min on top). You are allowed to use only the stack operations such as
pop, push, isEmpty and peek.
Example: suppose A={(top)1,4,7,9} and B={(top)2,3,6}, then the function will return a new
stack D= {(top) 1,2,3,4,6,7,9}
Note: No other data structure is allowed other than stacks.
Question 3:(12 marks)
For each of the following expressions, find the dominant term(s) having the sharpest
increase in N or M and give the time complexity using Big-O notation.
Consider that we always have N>>M.
Expression Dominant term O(..)
N(100N + 200N3) + N3
N2 log N + N3/5 + 10004
10MlogM + (N/2) log (N/2) + N/4
5N log(10N) + 3 N2
10(N2 + N) / (N+5)
M log (N) + M log (M )
3 9 5
2 8 7
1 8 4
5 9 3
7 8 2
4 8 1
3
Question 4:(8 marks)
A prime number is a natural number greater than 1 that has no positive divisors other than
1 and itself.
On the other hand, a composite number is a natural number greater than 1 that is not a
prime number.
For example, 5 is prime, as only 1 and 5 divide it, whereas 6 is composite, since it has the
divisors 2 and 3 in addition to 1 and 6.
Write a java method isPrimeNum that takes the number n, and checks whether the number
is prime or composite. The method should print at the end a message that indicates whether
n is prime or composite.
End of Assessment












_________________
الإجــابة النمــوذجية
----------------------

[عزيزي الزائر يتوجب عليك التسجيل لمشاهدة الإجابة النموذجية ، للتسجيل اضغط هنا] || الكاتب: [عزيزي الزائر يتوجب عليك التسجيل لمشاهدة الإجابة النموذجية ، للتسجيل اضغط هنا] || المصدر: [عزيزي الزائر يتوجب عليك التسجيل لمشاهدة الإجابة النموذجية ، للتسجيل اضغط هنا]






كورسات - حلول واجبات الجامعة العربية المفتوحة
لجميع تخصصات الجامعة ولجميع فروع الجامعة
حلول واجبات – مشاريع تخرج – ملخصات هامة
http://study.123.st/


Whatsapp: 00966541597560
مع نخبة من أفضل الاساتذه والمهندسين المتخصصين
كورسات - حلول واجبات - ملخصات - مراجعات قبل الامتحان
professor.tma@gmail.com
حلول مضمونة وغير مكررة وغير متشابهة لجميع واجبات الجامعة
متوفرمدرسين ومدرسات لجميع المواد والتخصصات
KSA-Kuwait-Bahrain-Oman-Jordon-Lebanon-Egypt

whatsapp:00966541597560
Admin

عدد المساهمات : 2019
تاريخ التسجيل : 04/01/2012

معاينة صفحة البيانات الشخصي للعضو http://study.123.st

الرجوع الى أعلى الصفحة اذهب الى الأسفل

استعرض الموضوع السابق استعرض الموضوع التالي الرجوع الى أعلى الصفحة

- مواضيع مماثلة

 
صلاحيات هذا المنتدى:
لاتستطيع الرد على المواضيع في هذا المنتدى