Preview

CW1

Satisfactory Essays
Open Document
Open Document
651 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
CW1
G52ADS: Coursework 1 on complexity analysis, Autumn abstract data types, and sorting algorithms 2014/15
This coursework is worth 50 marks representing 10% of your total course grade. Objectives: Learning basic techniques of the time complexity analysis, in particular, how to evaluate complexity of a given piece of Java code, analyse performance of algorithms with the Big-Oh notation, solve basic recurrences describing the performance, and sorting and searching algorithms.
Please read the following passage of text carefully:
Report: Your have to submit this coursework as a report in “pdf” format. You may prepare the report using an appropriate text editor, such as e.g. MS Word or LaTeX, which can output a “pdf”. Scanned handwritten documents are strictly forbidden (even as images included into an electronic text) and will not be accepted for marking.
Submission: The due date is Wednesday, 19th of November 2014, 11:59 p.m.
(Malaysian Time). If submitted after due date, the penalty is 5% for each day.
Submission must be through Moodle.
Marking Scheme:

Clear structure of your report and detailed explanations

% marks up to 30

Correctness of your final answers

up to 30

Correctness of your intermediate steps in deriving these answers

up to 40

100%
You should give detailed answers to all the following questions.

©Abdur Rakib 2014

Page 1

G52ADS: Coursework 1 on complexity analysis, Autumn abstract data types, and sorting algorithms 2014/15
Question 1.
(a) How many times does “time complexity” get printed in the following code fragment? Analyse and state the time complexity of this code using
Big-O notation, and in words.

int n; void funnyFunction(int n)
{
int count = 0; if (n > 1) funnyFunction(n-1); for(count =0; count< n; count++) print(“time complexity”);
}

[5 marks]

(b) Analyse and state the time complexity of the following function in terms of Big-O notation, and in words.

int peculiarFunction (int n){ if (n < 100) return 1; return n * peculiarFunction

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Wk1 Dq 1

    • 729 Words
    • 3 Pages

    What are some of the ethical challenges surrounding the movie and music industries as they relate to the Internet?…

    • 729 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    WB6-4

    • 447 Words
    • 2 Pages

    Escoge la categoría más apropiada para los siguientes objetos, lugares y actividades. a. Dormitorio b. Estadio c. Tienda de ropa d. Servicios para la comunidad e. Para ir una distancia corta f. Para ir una distancia larga g. Papelería h. Carnicería Objetos / Actividades / Lugares 1. sandalias • a • b • c (correct answer, your response) • d • e • f • g • h 2. Points earned: 1 out of 1 View exercise 2.…

    • 447 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    WGU VZT1

    • 2005 Words
    • 8 Pages

    While this section is not expressly requested in the task instructions, it is usually helpful to write a paragraph that introduces Company G and the product that you are writing this marketing plan about.…

    • 2005 Words
    • 8 Pages
    Better Essays
  • Satisfactory Essays

    Use the provided space to answer the following questions. If more space is needed, use the back of the page.…

    • 780 Words
    • 10 Pages
    Satisfactory Essays
  • Powerful Essays

    Hat1- Wgu

    • 2051 Words
    • 9 Pages

    There is a sign on the Highway as you enter Celina that reads, “One of 100 best small towns”. Celina is a rural community in North Western Ohio. It is home of the largest manmade lakes ;{ it is 21 square miles covering over 13,500 acres in both Mercer and Auglaize counties.}Corn fields and farms surround the city on all sides and country air can make an outsider either smile or cover their nose; 60.6% of the population is rural living. Main street is home of some of the city’s oldest buildings and is where the Court house is located. Friday nights are for football games in the fall and basketball in the winter. Sunday mornings you can wake to the sound of church bells. Occasionally you’ll hear the whistle of a train on the only working track. It’s not as friendly as the famous Mayberry but it’s a city where most know you or your family by name.…

    • 2051 Words
    • 9 Pages
    Powerful Essays
  • Good Essays

    ch09 theteam

    • 4699 Words
    • 27 Pages

    5. The buy-in of a quality venture capital team is one of the major differences between a firm that provides its founder simply a job substitute, and a higher-potential venture.…

    • 4699 Words
    • 27 Pages
    Good Essays
  • Satisfactory Essays

    hw9

    • 296 Words
    • 1 Page

    The American Civil War was the war that a society in the America against the other society, which it showed the policy conflicts between these two societies that they could not get alone well. By the Civil War happened, it awoke the government and the political leadership to use their ability to modernize the policy, society and economic resources to be able to keep up fighting to defeat the other society to show their development was better then the other.…

    • 296 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    Concept Programing

    • 443 Words
    • 3 Pages

    1) n > 0 and count = n => count > 0 before the while loop…

    • 443 Words
    • 3 Pages
    Good Essays
  • Good Essays

    Riwt 1

    • 1110 Words
    • 5 Pages

    Lets take a journey. A journey back to a time and a place that is unknown to us without the history and expression of Literature and Art. These moments are the expression of color, the fine detail, the heroics, and the stories that bring us to our current and most knowledgeable time in literature and the arts. Neoclassicism and Romanticism are two very important time periods in the literary movements in English literature that helped shape our way of life today. Although these time periods are recognized as very opposite they share many similarities and we continue to learn and grow from them.…

    • 1110 Words
    • 5 Pages
    Good Essays
  • Satisfactory Essays

    Read Me First Wk1

    • 515 Words
    • 2 Pages

    This course explores communication and how it affects the health care setting. As you begin your reading, identify the key components of communication and analyze how they affect the quality of interpersonal relationships.…

    • 515 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Cypw

    • 554 Words
    • 3 Pages

    The effective provision of pre-school education (EPPE) project is the first major European longitudinal study of a national sample of young children's development (intellectual and social/behavioural) between the ages of three and seven years. To investigate the effects of pre-school education for three- and four-year-olds, the EPPE team collected a wide range of information on more than 3000 children, their parents, their home environments and the pre-school settings they attended (http://www.education.gov.uk/childrenandyoungpeople/earlylearningandchildcare/evidence/a0068162/effective-provision-of-pre-school-education-eppe)…

    • 554 Words
    • 3 Pages
    Good Essays
  • Good Essays

    K101

    • 342 Words
    • 2 Pages

    In the beginning of unit one it becomes apparent that there are many difficulties involved in being a carer, the main difficulty that stood out for me is that many carers feel they have little or no choice in regards to who will care for the family member in question. Almost immediately we were made aware that Ann was expected to take on the role of caring for her step-father Augus when her mother passed away. Ann along with many other carers feel a sense of ‘Family duty’ when it comes to caring for a relative.…

    • 342 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Cypw

    • 1054 Words
    • 5 Pages

    I first decided to become a childminder after speaking with a friend of mine who already was a childminder. We discussed how I used to work abroad as an au pair and how my career as a medical insurance consultant was no longer what I wanted to do. She told me all about childminding and how it was a flexible approach to working life whilst balancing family life too.…

    • 1054 Words
    • 5 Pages
    Satisfactory Essays
  • Satisfactory Essays

    D1

    • 398 Words
    • 2 Pages

    Planned curriculum activities can promote learning by following the EYFS curriculum and making the children helping them learn communication and language, physical development, personal, social and emotional development and the specific areas of learning are literacy, mathematics, understanding the world and expressive arts and design. The practitioner has to meet these requirements such as I did a floating and sinking activity with groups of children this fell into science as well as communication and language and understanding the world/the world. Every activity has to have some educational meaning behind it but they have to make it fun for the children as well such as going on a bear hunt and learning about bears. This was a good example as they are also learning about the world because they got shown a book full of animals and had to point out the pictures of bears, they then got asked where a polar bear lived and where the brown bear lived and the next day they got asked the same question and they knew the brown bear lived in the woods as they learnt on the bear hunt and the polar bear lives in the snow.…

    • 398 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    CWV101

    • 900 Words
    • 3 Pages

    This teaching can be used in all worldviews. Although these teachings are from Jesus, it can be used in all worldviews. His love, kindness is universal and can be used to influence different worldviews.…

    • 900 Words
    • 3 Pages
    Good Essays