Week 1 Lecture 1 Introduction
Week 1 Lecture 1 Introduction
Lecture 1: Introduction
▪ Email: [email protected]
▪ Objectives:
▪ Text books:
▪ Reference books:
▪ Assignments : 10%
▪ Quizzes : 10%
▪ Mid Term : 30 % 75%
▪ Final : 40%
▪ Project Doc. : 10%
▪ Lab Tasks : 70%
25%
▪ Final Lab : 10%
▪ Project : 20%
► Non-primitive or User-Defined:
- Linear vs Non-linear
▪ How many cities with more than 250,000 people lie within
500 km of Islamabad?
▪ Data Search
► E.g., an inventory of 1 million(106) items of a store
▪ Processor Speed
► Processor speed although being very high, falls limited if the
data grows to billion records
▪ Multiple Requests
► As thousands of users can search data simultaneously on a
web server, even the fast server fails while searching the data
▪ Interface
► Represents the set of operations that a data structure
supports &
► Only provides the list of supported operations, type of
parameters they can accept and the return type of these
operations
▪ Implementation
► Provides the internal representation of a data structure &
► The definition of the algorithms used in the operations of the
data structure
▪ Issues
► Space needed
► Operations efficiency (Time required to complete operations)
- Retrieval
- Insertion
- Deletion
array
Linked list
queue
tree stack
▪ Algorithm
► Definition
▪ Examples
► sort a list of numbers
► find a route from one place to another (cars, packet routing,
phone routing, ...)
► find the longest common substring between two strings
► microchip wiring/design (VLSI)
► solving sudoku
► cryptography
► compression (file, audio, video)
► pagerank
► classify a web page
► Does it terminate?
▪ Ordering
► Put keys into some order so that we know something about where
each key is relative to the other keys.
► Phone books are easier to search because they are alphabetized.
▪ Linking
► Add pointers to each record so that we can find related records
quickly.
► E.g. The index in the back of book provides links from words to the
pages on which they appear.
▪ Partitioning:
► Divide the records into 2 or more groups, each group sharing a
particular property.
► E.g. Multi-volume encyclopedias (Aa-Be, W-Z)
► E.g. Folders on your hard drive