حلول واجبات الجامعة العربية المفتوحة المضمونة AOU

حلول واجبات الجامعة العربية المفتوحة لجميع تخصصات الجامعة ولجميع فروع الجامعة حلول واجبات – مشاريع تخرج – ملخصات هامة Mobile: 00966542495275 حلول واجبات الجامعة ا
 
الرئيسيةالرئيسية  س .و .جس .و .ج  بحـثبحـث  الأعضاءالأعضاء  المجموعاتالمجموعات  التسجيلالتسجيل  دخول  

شاطر | 
 

 1 M180: Data Structure and Algorithms in Java Tutor-Marked Assignment (Spring 2014/2015) Cut-Off Date: 25-4-2015 Total Marks: 40 Contents Warnings and Declaration…………………………………………………………………………..……..1 Question 1……………..……………………….………………………………………………………….2 Quest

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


المساهمات : 2563
تاريخ التسجيل : 23/01/2012

مُساهمةموضوع: 1 M180: Data Structure and Algorithms in Java Tutor-Marked Assignment (Spring 2014/2015) Cut-Off Date: 25-4-2015 Total Marks: 40 Contents Warnings and Declaration…………………………………………………………………………..……..1 Question 1……………..……………………….………………………………………………………….2 Quest   الثلاثاء مارس 10, 2015 5:37 am

1
M180: Data Structure and Algorithms in Java Tutor-Marked Assignment (Spring 2014/2015) Cut-Off Date: 25-4-2015 Total Marks: 40 Contents Warnings and Declaration…………………………………………………………………………..……..1 Question 1……………..……………………….………………………………………………………….2 Question 2 ………………..…………………………………………………………………………….….3 Question 3 ………….………..………………………………………………………………………….….3 Question 4 ………….…………..……………………………………………………………………….….4 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: (10 marks) In statistics, the Combination is a method of selecting several items or symbols out of a larger group or a data set, where order does not matter. The Combination is represented by or nCk, and calculated from the formula: nCk = n!/(k!(n - k)!) For example , if you have a list of 5 numbers {1,2,3,4,5} ,then 5C2 means you are given a list of 5 number, but you only need to choose 2. The order that you choose them in NOT important. The number of combinations will be 10: 5C2 = 5!/(2!(5 - 2)!)= 120/12=10 And the combinations are: {1,2},{1,3},{1,4},{1,5},{2,3},{2,4},{2,5},{3,4},{3,5},{4,5} One way of computing the value of which we can denote by nCk (read as n choose k) is to use the recursive formula: with initial and boundary values a) Write a recursive method nChoosek that takes two non-negative integers n and k, and returns the value of nCk described above. b) Show schematically what happens when we call the above method with the numbers 4 and 2 for n and k respectively.
3
Question 2: (6 marks) For each of the following, give the time complexity using Big-O notation and explain your answer. Note that the running time corresponds here to the number of times the operation sum++ is executed. sum = 0; for(i=0; i<n/2; i++) sum++; for(j=0; j<n; j++) sum++; for(k=0; k<n; k=k+2) sum++; sum = 0; for(i=0; i<n; i++) for(j=0; j<n; j++) for(k=j; k<j+5; k=k+1) sum++; sum = 0; for(i=0; i<n; i++) for(j=0; j<n; j*=2) sum++; for(k=n; k>0; k--) sum++; Question 3: (6 marks) You are given a Stack class. The following functions are available for use: public class Stack { public boolean isEmpty(){}; public void push(int n){}; public int peek(){}; public int pop(){}; } Also, You are given a Node class and a List class: public class Node{ int data; Node next; } public class List{ Node first; } Write a Java method that prints the data of a single linked list backward, using stack.
4
Question 4: (6 marks) As a conclusion of what you have learnt about them, you are asked to compare the Arrays with Stacks and Queues in terms of three of the following: their roles, access restrictions, ease of search, insert or delete operations. Question 5: (12 marks) You are supposed to write a method symmetric that accepts a stack of integers as a parameter and replaces the stack contents with itself plus a symmetrical version of itself (the same elements in the opposite order). For example, suppose a variable s stores the following elements: bottom [10, 50, 19, 54, 30, 67] top After a call of symmetric(s),the stack would store the following elements bottom [10, 50, 19, 54, 30, 67, 67, 30, 54, 19, 50, 10] top Note that the symmetric version is added on to the top of what was originally in the stack. The bottom half of the stack contains the original numbers in the same order. If your method is passed an empty stack, the result should be an empty stack. If your method is passed a null stack, your method should throw an IllegalArgumentException. a) Write the method symmetric using one temporary stack and one temporary queue. b) Re-write the method using only one temporary Queue. End of Assessment

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


Watsapp: 00966542495275

خدمات مجانية – حلول واجبات الجامعة العربية المفتوحة
لجميع تخصصات الجامعة ولجميع فروع الجامعة
حلول واجبات – مشاريع تخرج – ملخصات هامة
http://learning.123.st/
http://aoua.forumegypt.net/
http://tarbawy.123.st/


Watsapp: 00966542495275

smsm.hamdy66@yahoo.com
حلول مضمونة وغير مكررة وغير متشابهة لجميع واجبات الجامعة
متوفرمدرسين ومدرسات لجميع المواد والتخصصات
KSA-Kuwait-Bahrain-Oman-Jordon-Lebanon-Egypt
الرجوع الى أعلى الصفحة اذهب الى الأسفل
معاينة صفحة البيانات الشخصي للعضو http://learning.123.st
 
1 M180: Data Structure and Algorithms in Java Tutor-Marked Assignment (Spring 2014/2015) Cut-Off Date: 25-4-2015 Total Marks: 40 Contents Warnings and Declaration…………………………………………………………………………..……..1 Question 1……………..……………………….………………………………………………………….2 Quest
الرجوع الى أعلى الصفحة 
صفحة 1 من اصل 1

صلاحيات هذا المنتدى:لاتستطيع الرد على المواضيع في هذا المنتدى
حلول واجبات الجامعة العربية المفتوحة المضمونة AOU :: حلول واجبات الجامعه العربيه المفتوحه 2017/2018 fall :: قسم حلول الواجبات القديمة-
انتقل الى: