wagbat.123

aou حل واجبات الجامعه العربيه المفتوحه
 
الرئيسيةالرئيسية  اليوميةاليومية  س .و .جس .و .ج  بحـثبحـث  الأعضاءالأعضاء  المجموعاتالمجموعات  التسجيلالتسجيل  دخول  

شاطر | 
 

 حل واجب M180

استعرض الموضوع السابق استعرض الموضوع التالي اذهب الى الأسفل 
كاتب الموضوعرسالة
whatsapp::00966542495275
Admin


المساهمات : 71
تاريخ التسجيل : 22/08/2016

مُساهمةموضوع: حل واجب M180   الجمعة أغسطس 26, 2016 4:48 pm

1
M180: Data Structure and Algorithms in Java
Tutor-Marked Assignment (Summer 2015/2016)
Cut-Off Date: August 20, 2016
Total Marks: 40
Contents
Warnings and Declaration………………………………………………………………………………..1
Question 1……………..……………………….………………………………………………………….2
Question 2 ………………..…………………………………………………………………………….….2
Question 3 ………….………..………………………………………………………………………….….3
Question 4 ………….…………..……………………………………………………………………….….3
Question 5………….…………..……………………………………………………………………….….4
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: (4 marks)
Some have stated that linked lists are much better than arrays. If that is always a valid
statement, then why are arrays used at all?
As a conclusion of what you have learnt about them, you are asked to compare the Arrays
with Linked lists in terms of one of the following: access restrictions, ease of search, insert
or delete operations. Give an example to support your answer.
Question 2:(10 marks)
You are given a Node class and a List class:
public class Node {
int data;
Node next;
Node(int d, Node n){
data = d;
next = n;
}
}
public class List{
Node header;
}
Write a java method insertNodeBefore( ) which takes two integers (int ref which is the data
of the node that we need to insert a new node before, and int d which is the data of the new
node we want to insert), for the list mylist.
3
Question 3:(8 marks)
Consider the following code fragment
public int mystery(int a, int b)
{
if (b==1)
return a;
else
return a + mystery(a,b-1);
}
a. Draw the decomposition &composition of mystery(2,3)?
b. What would be the value of mystery(2,0)?Discuss.
Question 4:(9 marks)
For each of the following, find the dominant term(s) having the sharpest increase in n and give
the time complexity using Big-O notation. Consider that we always have n>m.
Expression Dominant term(s) O(. . .)
3n log n +30 logm
100n + 0.01n2
0.01n+ 100logn
2n +n0.5 + 0.5n1.25
5n log m2 + n( logn )2
10n log(3n) + n3 + 100m2logm
4
Question 5: ( 9 marks)
Given the following Matrix, which represents an output of a certain code:
You are asked to:
a) Write a java code defining a two dimensional array, and using the nested loop that
produces the above matrix as an output.
b) Run the code and include a snapshot of the output.
PS: You need to find a relation between i & j and write the code; run it and then
include the screen shot.
End of Assessment



مع نخبة من أفضل الاساتذه والمهندسين المتخصصين


الرجوع الى أعلى الصفحة اذهب الى الأسفل
معاينة صفحة البيانات الشخصي للعضو http://wagbat-123.a7larab.net
 
حل واجب M180
استعرض الموضوع السابق استعرض الموضوع التالي الرجوع الى أعلى الصفحة 
صفحة 1 من اصل 1

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
wagbat.123 :: حل واجبات الجامعه العربيه المفتوحه whats.app: 00966542495275 :: حلول واجبات 2016 AOU(يشاهدة الآن 3537 زائر)-
انتقل الى: