Introduction to Data Structure

Only available on StudyMode
  • Topic: Top-down and bottom-up design, Data type, Abstract data type
  • Pages : 9 (2894 words )
  • Download(s) : 97
  • Published : April 17, 2013
Open Document
Text Preview
Lecture 1
1.1 INTRODUCTION Data structure is the branch of computer science that unleashes the knowledge of how the data should be organized, how the flow of data should be controlled and how a data structure should be designed and implemented to reduce the complexity and increase the efficiency of the algorithm. The theory of structures not only introduces the data structures, but also helps to understand and use the concept of abstraction, analyze problems step by step and develop algorithms to solve real world problems. Thus it enables various data structures like stacks, queue, linked list, trees and graphs. Effective use of principles of data structures increases efficiency of algorithms to solve problems like searching, sorting, populating and handling voluminous data. 1.2 Basic Terminology of Data Organization Data: The term data means a value or set of values. For example, marks of students, figures obtained during exit polls etc. The data is stored in the memory of computer. Different models are used to organize data in the memory. For example, the model used to organize the data in main memory are collectively referred to as data structures, whereas the different models used to organize data in the secondary memory are collectively referred to as file structures. Data item:- A data item means a single unit of values. For example, roll number, name, address etc. Entity: Entity is something that has certain qualities, characteristics, properties or attributes that may contain some values. For example, Student is an entity. The attributes of student may be roll number, name, address, etc, The values of these attributes may be 100, Ram, House No. 133-A, Pragati Vihar, Delhi. Entity Set: An entity set is a group of or set of similar entities. For example, employees of an organization, students of a class etc. Information: When the data is processed by applying certain rules, new processed data is called information. The data are not useful for decision marking whereas information is useful for decision making. Field: Field is a single elementary unit of information representing an attribute of an entity. For example, 1, 2, 3, 4….etc are represented by a single unit called roll number field. Record: Record is a collection of field values of a given entity. For example, roll number, name, address etc. of a particular student. File: File is a collection of records of the entities in a given entity set. For example, file containing records of students of a particular class. Key: A key is one or more field(s) in a record that take(s) unique values and can be used to distinguish one record from the others. There are three cases:

Case 1: When more than one field may have unique values. In that case, there exist multiple keys, but at a time we use only one field as a key, called primary key. The other key(s) are called as alternate key(s). Case 2: There is no field that has unique values. Then a combination of two or more fields can be used to form a key. Such a key is called composite key. Case 3: There is no possibility of forming a key from the within the record. Then an extra field can be added to the record that can be used as a key. 1.3 Need of Data Structure A data structure helps to understand the relationship of one data element with the other and organize it within the memory. Sometimes the organization might be simple and can be very clearly visioned, for example, list of names of months in a year. We can see that names of months have a linear relationship between them and thus can be stored in a sequential location or in a type of data structure in which each month points to the next month of the year and it is itself pointed by its preceding month. This principle is overruled in case of first and last month's names. Similarly, think of a set of data that represents location of historical places in a country. For each historical place the location is given by country name followed by state name followed by...
tracking img