0% found this document useful (0 votes)
27 views10 pages

DSA - Unit1 - U-1

Introduction to structures
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views10 pages

DSA - Unit1 - U-1

Introduction to structures
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

21CSC201J

DATA STRUCTURES AND


ALGORITHMS
UNIT 1 - Introduction
Prepared by

Dr L Josephine Usha
Dr P Shunmuga Sundari
Dr R Deepalakshmi
Topics to be covered

Programming in C – Primitive data types, Structures, Self-referential


structures, Pointers and structures, Dynamic memory allocation, Matrix
multiplication; Data Structure – Definition, Types, ADT, Operations;
Mathematical notations - Big O, Omega and Theta , Complexity – Time,
Space, Trade off.
INTRODUCTION
BASIC TERMINOLOGY
Introduction
• Data Structure can be defined as the group of data elements which
provides an efficient way of storing and organizing data in the computer
so that it can be used efficiently.
• Some examples of Data Structures are arrays, Linked List, Stack, Queue,
etc.
• Data Structures are widely used in almost every aspect of Computer
Science i.e. Operating System, Compiler Design, Artificial intelligence,
Graphics and many more.
Basic Terminology
• Data are values or sets of values
• A data item refers to a single unit of values. Data items are divided into
subitems are called group items.
o For example, an employee’s name may be divided into three subitems
first name, middle name and last name but the social security number
would treated as a single name.
• Collections of data are organized into a hierarchy of fields, records and
files.
Basic Terminology (Cont..)
• Record can be defined as the collection of various data items.
o For example, if we talk about the student entity, then its name, address,
course and marks can be grouped together to form the record for the
student.
• Record is classified according to length. A file can have fixed length
records or variable length records.
• In fixed length records, all the records contain the same data items with
the same amount of space assigned to each data items.
• In variable length records, file records may contain different lengths.
Variable length records have a minimum and a maximum length.
o For example, student records have variable length, since different
students take different numbers of courses
Basic Terminology (Cont..)
• A File is a collection of various records of one type of entity.
o For example, if there are 60 employees in the class, then there will be 20
records in the related file where each record contains the data about
each employee.
• An entity represents the class of certain objects. It contains various
attributes. Each attribute represents the particular property of that entity.
o For example, consider an employee of an organization:
Attributes: Name Age Sex Social Security Number
Values: JOHN 34 M 134-24-5533
• Field is a single elementary unit of information representing the attribute
of an entity.
Basic Terminology – Example
• A professor keeps a class list containing the following data for each student:
Name, Major, Student Number, Test Scores, Final Grades
a) State the entities, attributes and entity set of the list.
b) Describe the field values, records and file.
c) Which attribute can serve as primary keys for the list?

a) Each student is an entity, and the collection of students is the entity set. The properties, name,
major, and so on. of the students are the attributes.
b) The field values are the values assigned to the attributes, i. e., the actual names, test scores,
and so on. The field values for each student constitute a record, and the collection of all the
student records is the file.
c) Either Name or Student Number can serve as a primary key, since each uniquely determines
the student’s record. Normally the professor uses Name as the primary key, but the registrar may
use students Number.
Programming in C
Introduction
• C is a programming language developed at AT & T Bell
Laboratories of USA in 1972, designed and written by “Dennis
Ritchie”.
• C is highly portable i.e., software written for one computer can
be run on another computer.
• An important feature of C is its ability to extend itself.
• Basically it is a collection of functions.

You might also like