Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Unit: Advanced Programming

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

Unit: Advanced Programming

Introduction

A computer program is an implementation of a problem specification: we


are given a task and must then design a program to implement this task.
The problem specification is often ambiguous and prone to change -
ensuring consistency and a good methodology for specification
development is part of Software Engineering, which is covered elsewhere.
Our prime concern as a programmer is to develop a detailed plan to tackle
the problem - an algorithm. This algorithm is a high-level description from
which we can generate the program statements. The algorithm is objective
and reflects the programming logic required to achieve the task, while the
specification is simply a broad statement of the problem under review.

Naturally, we wish our program to run as speedily as possible. To this end,


the algorithm that we extract from the specification must be efficient, in
terms of both the time required and memory usage. This requires some
sort of algorithm analysis, in which we examine the performance of our
proposed algorithm using a set of mathematical tools. While the standard
techniques used to accomplish this are not terribly accurate, they do
provide an indication of the utility of the algorithm under a given set of
criteria. Programs manipulate data, so most of the efficiency tests for an
algorithm examine the speed with which it can process data. If we can
construct an analysis of our algorithm, we know how it will perform for very
large amounts of data, and thus whether it is of any use. Imagine an
algorithm which has ``combinatorial complexity'' for N data items: N*(N-
1)*...2*1. For even moderate values of N, say 30 or 40, this value is
enormous. For N=30, we have 1.7*10^98! Any algorithm which requires
this much time or space is of no practical benefit. If our analysis reveals
such a fact, then we have to approach the problem from a different angle
and formulate a new, more efficient, algorithm.

A fundamental component of successful algorithm design is the efficient


manipulation of data. For instance, if you wish to search through a
collection of N data items, the most obvious algorithms may require as
many as N steps (moving from the start of the collection to the end). If you
have a database application, say, with 10^10 records, this means you
would spend a vast amount of time scanning through your data to find the
desired item! Fortunately there are better ways of organising data to
achieve fast and efficient manipulation. A Data Structure is a specific way
of organising data, and the study of different data structures, along with
the algorithms used to manipulate them, forms an important part of
computer science. To write effective and efficient programs, you will need
to familiarise yourself with the standard data structures of computer
science. Simple Data structures such as Lists, Queues and Stacks are
widely used, but are only efficient for a small set of tasks. More powerful
data structures such as Trees and Graphs provide elegant solutions to
many interesting problems, but are more complex and difficult to
implement.

Unit Objectives

• After completing this unit, you will have a good understanding of the
basic data structures of computer science. More specifically, you
should:
• appreciate the issue of algorithm complexity, and its impact on your
programs;
• understand the fundamental data structures and their associated
algorithms;
• have gained some experience in determining which data structures
are appropriate to a given task.

Study
You should expect to spend approximately 9 hours studying this unit.
However, if you have never programmed before you may find that
learning about programming concepts and to program with Java takes
considerable time and you end up taking more than the 9 hours. Often
students find that the more time they invest in studying the basic
principles, as discussed in this unit, the more efficient they become
later. You may find it convenient to break up your study as follows:

Preparation (Introduction and On-line Planning): ½ hour

Disk-based Content: 2¾ hours

Application: 3 hours

Set textbook Content: none

Reflection (On-line discussions, review questions): 1 hour

Tutorial Work: 1 hour

Related Coursework: ¼ hour

Extension Work: ½ hour


Coursework and Exams for Module
The grade for the module is based on coursework (30%) and the final
exam (70%).

Prerequisites for Unit


Completion of the Introduction to Java programming module

Equipment Software Required


A Web browser – for browsing Web sites. All modern popular browsers
should suffice, that is Netscape Navigator 4 (or later version) or
Microsoft Internet Explorer 4 (or later). For many of the practical activities
of this unit, you will :
• Sun Java 2 Platform (also known as Java Development Kit). A
web browser.
• A text editor: For the editing and writing of computer programs.
Windows already provides a simple text editor, called "Notepad"
which is sufficient for editing and viewing Java Programs.
However, you might also like to install an editor designed
especially for working with Java programs and HTML files, such a
product like "TextPad". It is possible to edit Java programs with
powerful word processors, such as Microsoft Word, however you
must be careful to save your programs as text files not in the
normal format for the word processor.

Unit Reading material and resources


M A Weiss, Data Structures & Algorithm Analysis in Java
Addison Wesley
ISBN 0-201-35754-2
This document was created with Win2PDF available at http://www.daneprairie.com.
The unregistered version of Win2PDF is for evaluation or non-commercial use only.

You might also like