What is a database
A database is any organized collection of data.
Some examples of databases you may encounter
in your daily life are:
a telephone book
airline reservation system
motor vehicle registration records
papers in your filing cabinet
ECS417U Lab sheet for week 4
1, Create, test, and validate an XHTML document to describe an ordered list of your
five favourite movies (the most favourite one is put on the top of the list).
2, Add a nested, unordered list of at least two actor
ECS417 Lab sheet for week 3
Write a XHMTL document that will display three paragraphs (each paragraphs can
contain just a few words of text). Write the markup so that there is more vertical space
between the second and third paragraphs than the
ECS417 Lab sheet for week 2
Before doing the exercises, you should familiarise yourself with the student web
server webprojects (https:/webprojects.eecs.qmul.ac.uk/info/).
1. Log on to linux on a computer in the ITL ground floor.
2. Go through the instruc
ECS417U Lab sheet for week 5
Practice writing simple document level style rules. In the following exercises, make
use of the following declarations (one per line):
font-size : 24pt;
These will be referred to as the bac
ECS417U Lab sheet for week 9
Write a PHP script to detect the type of browser used to display the script. The
information about the browser being used can be found in the value of a special
reserved PHP variable (more accurately an array elemen
ECS417U Lab sheet for week 8
Write a PHP script that calculates the time (in seconds, minutes, hours, days, weeks,
and years) passed by since your birthday. You should use the built-in functions date()
and time(). A detailed description of thes
ECS417U Lab sheet for week 6
Rewrite the simple personal webpage in exercise 5 of week 4 lab sheet following a
two-column CSS layout template which can be downloaded at the course website (the
link is next to the link for this lab sheet). After
ECS417U Lab sheet for week 10
Write the XHTML code to create a form with the following capabilities:
1. A text widget to collect the users name
2. Four checkboxes, one each for the following items
a. Four 100-watt light bulbs for $2.39
Magic-Eye Traffic Control System (METC-system)
The following scenario is used for you Assessment. Read the scenario carefully before
Continuing rapid traffic growth in the Mile End Area requires urgent action to prevent
gridlock. The Greater
Pros & Cons
security and encryption. Your information remains confidential and secure because only
your browser and the server can decrypt the traffic.
Authenticity of News Del
4. On the Move (Variables, Assignment and Declarations)
But it does move
Assignment and Variables
Storage space is very important in programming. Programs process information and
that information needs to be stored somewhere. Processing it
13. The Search is On (Search Algorithms)
Canst thou by searching find out God?
The Bible, Job Chapter 11, verse 7.
Take a pack of cards. Shuffle it thoroughly. Now find the Four of Spades. How did
you do it? Put that card back and shuffle th
6. Play it Again Sam
(Iteration and Recursion)
Oh No Not Again
The Bowl of Petunias (Douglas Adams),
The Hitch Hikers Guide to the Galaxy (1979).
Repetition (often called Iteration) is important to Computer Scientists because one of
2. The Language Instinct (Programming Languages)
The communication of the dead is tongued with fire
beyond the language of the living.
T.S. Eliot, Four Quartets Little Gidding, (1940)
Algorithms are just instructions used to describe actions. In
9. Repair, Reuse, Recycle (Object-oriented Programming)
I have done one braver thing
Than all the worthies did,
And yet a braver thence doth spring
Which is to keep that hid.
John Donne, Songs and Sonnets The Undertaking
What we have looked at so far has
3. Plumbing (Sequence)
If I am to successfully do something following a set of instructions, I must know two
different kinds of things. I must of course know what the individual instructions are.
Less obviously I must also know what o
14. All Sorts of Everything (Sort Algorithms)
All things began in order, so shall they end and so shall they begin again.
Sir Thomas Browne, The Garden of Cyrus (1658) Ch. 5
We often need to sort things into some given order, and there are very many ways
11. The Other Queue Always Goes Faster (Queues and
Waitin' for when the last shall be first and the first shall be last
Bruce Springsteen, The Ghost of Tom Joad,1995,
cf The Bible, St Mathew ch. 19, v. 26.
Queues and queuing are an integral part o
5. If only. (Selection)
Is all good structure in a winding stair?
George Herbert, Jordan (1633).
Sequencing is not the only form of plumbing used in programming: it is not the only
way instructions can be ordered. Another form of plumbing is known as sele
7. Bigger and Better (Comments, Functions and
Most of the sets of rules an instructions we come across in everyday life are small. For
example, the instructions on the side of a packet of pasta about how to cook it are
usually a few lines long
1. Out of Disorder
Disorder, horror, fear and mutiny shall here inhabit.
William Shakespeare, Richard II (1595) Act 4 scene 1, 1.139
Humans hate disorder. We try and organise our lives, our cities, our homes and even
sometimes our desks and
12. Seeing the Wood for the Trees (Dynamic Data
It is often better to be in chains than to be free.
Franz Kafka. The Trial (1925) Ch. 8.
Queues and stacks are variations on lists where entries can only be added and
removed in cert
10. The Pecking Order (List and Array Data Structures)
Blot out, correct, insert, refine,
Enlarge, diminish, interline.
J. Swift, On Poetry, (1733) l.85.
One of the most common structures, both in Computer Science and in real life is the
8. In-Out, In-Out, Shake it all About (Input-Output)
Communicating with the outside world
Humans think. The human mind is locked inside the body that is a human. Humans do
more than just think though they take note of things happening around them and
17. The Right Choice (Choosing Algorithms)
Sometimes I sits and thinks, and sometimes I just sits.
Engraving on a bench, adapted from Punch, Volume 131, page 297 (1906)
Suppose I told you I wanted a pizza for lunch and asked you to sort it out. There are
15. The Path of Righteousness (Path Algorithms)
Thou shalt find it after many days
The Bible, Ecclesiastes Chapter 11, Verse 3.
As we saw previously, graphs occur in a wide range of situations. What kind of
computation might we then want to do on them? On
16. Greedy Algorithms
A simple and common way to solve problems and that forms the basis of many
algorithms, is the idea of Greed! Sometimes this works really well. At other times it is
a really bad thing to do. Consider the survival strategy of the Croco
18. The End is Nigh
In my end is my beginning.
Mary Queen of Scots, embroidered motto.
The main aim of this book has been to introduce some of the main data structures and
algorithms in a familiar context. We use many of the data structures and algorithms