Search Engine project for

Introductory programming,
Object Oriented Programming,
Database Systems,
Concurrency and
Introduction to Algorithms and Data Structures

May 2003

The danish version of this page can be found here(will not be updated!!!!)

Table of contents

This page: Other:

Introductory information

Welcome to the homepage of the Search Engine Project. The Search Engine Project is for students with different skills and goals. All groups are required to solve the assignments mentioned in the section The joint part below. Special arrangements regarding the Joint part can be done with the teacher. When a group has solved the joint part, they have the first primitive version of a search engine for IT-C.

After the joint part the group can move on in several directions. For instance they can do one or more of the suggested extra assignments. What each group choose to work on will depend on interest and skills. In case the group has no other skills than introductory programming it is not expected to do more than the joint part during the project weeks. Groups with more skills are expected to hand in more than the joint part.

Each group are required to do a project agreement. Each group will have to describe its work done in a report, and this report is defended at a project exam.

During the project project days are held, where general information regarding the project will be given and questions can be asked. Furthermore meetings with each of the individual groups and the instructors will be held. If you or your group has any problems during the project you are welcome to take contact to one of the teachers, assigned for the course. There will also be an instructor for helping with programming problems or other problems of a more specific character.

At the first project day the project is presented and it will be possible to create the final groups, if this is not done already. Furthermore the programming techniques, which are needed for solving the joint part are presented. Therefore in the describtion below of the assignment there will supposedly be words you don't know before the first project day has been held. Parts of the text will be especially incomprehensible if you haven't heard about linked lists. Linked lists are one of the programming techniques presented at the first project day.

The assignment

Data files

To use for the project different data files containing the whole or parts of the homepage of IT-C is available. The format of the files can be illustrated by the following example:


The idea is, that a data file contains information about a series of homepages. The information for a homepage starts with a *PAGE line which denotes at which address the the page can be found. Such an address is called a URL. A list of the words contained in the page follows the URL. The words are just listed one word at a time on each line in the same order as they occur on the page. As seen in the example each word can have several occurences on the same page.

You can get the following datafiles where the first two contains part of the homepages of IT-C and the last one contains all of them:

These files can also be found in the folder:


and it is recommended to use them directly from there when on IT-C.

When working using Linux the files can be found in the folder /import/share/stud/sysadm/soegemaskine/

The program SearchCmd

As part of this assignment the program is handed out. It implements a little search engine. From the command promt the name of the data file to use for searching is provided as a parameter to the program and the program is run. Refer to about the use of Java below for information on how to pass parameters to Java programs.

The parameter passed to the program is put in args[0] where args is the parameter to the programs main method. The first thing the program does is to construct a linked list datastructures with all the lines from the data file which name is in args[0]. The objects in the linked list contains the fields str and next. The field str contains a line from the data file and next points to the next object in the list. After reading the data file a simple user interface is started, enabling the user to get an answer on whether a given word is in one of the homepages read from the data file.

The joint part

The joint part consists of solving the following 4 assignments, where assignment 3 is the largest. These assignments are presented at the first project day.
  1. Run the program SearchCmd.
  2. Modify SearchCmd in such a way that if a search for "Hans" for instance occurs, all of the URL's where "Hans" exists is written out to the screen. This has to be done by changing the search-method in SearchCmd. It is not done by changing the datastructure.
  3. Modify the construction of the datastructure in such a way that a linked list of objects containing three fields is created. The three fields are str, next and urls. The fields str and next are like in SearchCmd, with the exception that there are only words in the list and each word only occurs once. In case an object contains the word "Hans" in the field str the objects urls field will be a pointer to a list of the URL's, wihch contains the word "Hans". A list of URL's consists of objects with two fields; next and url. The field next is a pointer to the next object in the list and the field url is a pointer to a URL. After construction of this datastructure coresponding search routines has to be made. The datastructure created in this assignment is of less size than the structure from SearchCmd and is faster to search in.
  4. Modify the solution from assignment 3 in such a way that you in stead of having a linked list of the different words, store them in a hashtable datastructures. You have to create the datastructure using chained hashing. That mean that each entry contains a reference to a linked list. Use of such a datastructure will have a dramatic effect on the time it takes to build and search in the datastructure.

In the solution of the above assignments it is not allowed to use any other packages than and java.lang. As a consequence it is not allowed to use any of the classes from the java.util package. The reason for this demand is, that one of the purposes with this project is to learn how to program different datastructures and not just to learn how to use datastructures programmed by others.

As you can see it is allowed to use different methods on String objects. It is also allowed to use the method hashCode. It is also allowed to allocate arrays. If you have any doubt whether some Java functionality is allowed for use, contact one of the teachers.

For the assignments after the joint part there are no restrictions on the java functionality you must use.

The report

There are the following general demants for the report:

Furthermore there is the following requirements to the report, which are all related to the three search engines implemented in the joint part:

What the report contains apart from the joint part, depends on the work done by the group and the chosen focus on this work.

At Introductory programming there are made a note on how a project report might look. This note is recommended reading as preparation for this course. In the note an estimate of 25 pages are made for a project report. For this concrete project our estimate is less than 20 pages using a standard font (20 being a large report). Appendices are not counted in the 20 pages, neither are figures. Our experience shows that the following structure comprises a good report:

The desribtion of Searchmd ? can be done in the following way: If you find it relevant you can have a chapter after the foreword, describing linked lists, general demands for the input etc. which applies to all of the search engines described.


In order to solve the assignments in the joint part you need linked lists and hashing.

Linked lists are explained at the first project day. If you don't know about linked lists you can refer to "Java, Java, Java: object oriented problem solving" by Ralph Morelli, second edition, chapter 16.1 - 16.2. Alternatively take a look at this homepage. You can also get which contain a small example of the use of linked lists. A real good way to learn about linked lists is by experimenting and modifying this program.

As supplementary material on hashing we recommend the material that can be found at this homepage.

Extra assignments

The following is suggestions for assignments to do after the joint part. The ordering of these suggestions is random.

About the use of Java

In this part you can find some usefull information on the use of Java. For further and more basic information refer to Introductory programming. Furthermore there is a link to the Java API specification.

When running SearchCmd one needs to pas parameters to the main method. Furthermore it is necessary to use so-called jar-files for many of the extra assignments. In the following section it is described how to do these two things in different Java developing environments.

In general it can be mentioned that jar-files contains functionality apart from the one given by the standard implementation. A jar file is necessary both when compiling and executing a program that use the extra functionality. All the jar-files that are refered to on this homepage can also be found in the folder:



In BlueJ a program is executed by running the main method. A dialogobx appears where you have to provide the program parameters. Here for example you can write (beware of the use of double backslash):


meaning that you pass the above string to the program (i.e. it is placed in args[0]

In BlueJ you can use .jar files by selecting Options -> Preferences ->Libraries. From here click Add and find the correct jar-file that is needed.


If you use JCreator to translate and execute Java programs and encounters prooblems compiling and running the programs, enter the File menu and choose Close workspace each time JCreator is started.

You can pass parameters to a programs main-method in the following way: Choose Configure -> Options -> JDK Tools. In the field Select tools type select the value Run application and press <default>. Then press Edit and choose Parameters. Parameters can then be entered in the field Main (...).

You an use a jar-file by selecting Configure in the menu, then select Options and finally JDK Profiles. Choose JDK version 1.3 and Edit. Press Add and choose Add package providing the jar-file to use.

Commandline tools

The classical way of compiling and running java programs is by using the so-called commandline programs. You can translate the program in in the following way:


Then running the program, using the small file, in the following way:

  java SearchCmd s:\sysadm\soegemaskine\itcwww-small.txt

If you want to use a jar-file it is done by adding it to the CLASSPATH. This is already done for the jar-files refered from this homepage.

Administrative information

Important dates

Signing up for the project

The easiest way to sign up for the project is to go to the presentation of the project on 24. of april, where you can get help to find a group and fill out the project agreement. Be aware that at least two participants are required in a group unless otherwise is agreed on with the teacher. Our recommandation is at least 3 persons in a group.


This section describes in detail how to sign up for the project. Do the following steps:

  1. Go to the electronic project base If you do not have a password get one by clicking on the "get password" link. Follow the instructions and await the password in your e-mail.
  2. Click on "nyt projekt".
  3. In the field "Projektaftale - f´lles del" click "udfyld" and fill in the fields as follows:
  4. Click "Gem projektaftale (f´lles del)" and click "godkend" in the projektaftale field.
  5. In the field "Deltagere - individuelle oplysninger" fill in the fields as follows:
  6. Click "Gem individuelle oplysninger".
  7. Add each menber of the group by clicking "tilføj deltager" and filling out the form as described in 5.
  8. In the field "Vejledere" enter Philip Bille, click "tilføj vejleder", select "V´lg" and click "tilføj vejleder". Repeat these steps with the name Nina Bohr. This should give you Philip Bille as "Hovedvejleder" and Nina Bohr as "Bivejleder". Your group will be assigned a specific teacher later on. If you have special wishes please let us know.
  9. Finally, click "inviter" on both Philip Bille and Nina Bohr.
  10. The project agreement will be sent back to you ASAP by the teachers. As soon as you recieve it follow the instructions to sent to the study board. Note that you have to sent it to the study board before 28. april.

Project exam

The time for examination will be given later.

When the projects are handed in an exam plan will be made ASAP

Exam plan

Each group must defend their report at an oral examination. Based on the report an the oral examiation a character based on the 13-scale is given for each participant in the group.

Project days

During the project period there will be a number of days with lectures and discussion of most of the topics the in projects.

Project groups

Be aware that at least two participants are required in a group unless otherwise is agreed on with the teacher. Our recommandation is at least 3 persons in a group. The following groups have so far been created.

Group 1 : Lise Gregersen (IADS, OOP, DBS), Tine Høiris Bak, Erik Matthias Verdoner.

Group 2: Saba Jabeen (GP, ITPO, DBD), Susanne Hørby Christensen (IPBR, ITPO, DBS), Sune Gregor Steenskjold (GP, DBD), Hesham Martin Khiery Mahoud El Dakak (GP,DBD,DBS).

Group 3: Kun Gao (IADS, DS), Catalin Gabriel Oprea (OOP).

Group 4: Laila Elisabeth Wærness (GP), Susanne Terkildsen (GP), Sanne Nygaard, Marnie Mu-Tan Lai.

Group 5: Ulrik Duerlund Olesen (IAD), Bue Pedersen.

Group 6: René Lund Jensen (IAD, DS, PS), Wala Hussein Hamoud Alshahayib.

Group 7: Mica Roswall Pedersen (GP), Rikke Elisabeth Scheibel, Andreas Schroll-Fleischer.

Group 8: Torsten Skjødt (NP, IPBR), Jesper Bugge Jensen (GP), Martin Olsen (GP, DBS), Benjamin Quorning (IPBR, IADS).

Groups 1,3,5,6,8 : will be supervised by Philip Bille.

Groups 2,4,7 : will be supervised by Nina Bohr.

All teachers and students


Philip Bille (Teacher),
Nina Bohr (Teacher),
Jacob Borella (Teaching assistant), email:

Teaching assistant plan

The teaching assistant is in room 3.08 or in the terminal rooms. He can be found at the following times (changes may occur, but will be given at least 24 hours in advance):
day time
6/5 9-13
7/5 9-13
8/5 9-13
9/5 9-13
12/5 9-13
14/5 9-13
16/5 9-13
19/5 9-13
20/5 12-16
22/5 9-13
27/5 9-13
28/5 9-13
29/5 9-13