C Programming and Data Structures

Unit 8

Unit 8

Overview of Data Structure

Structure: 8.1

Introduction Objectives

8.2

Example of Data Structure

8.3

Abstract Data Types (ADT)

8.4

Levels of Data Structure

8.5

Type of Data Structure

8.6

Application of Data Structure

8.7

Summary

8.8

Terminal Questions

8.9

Answers to Self Assessment and Terminal Questions

8.1 Introduction A data structure is the organization of data in a computer's memory or in a file. The proper choice of a data structure can lead to more efficient programs. In computer science, a data structure is a way of storing data in a computer so that it can be used efficiently. It is an organization of mathematical and logical concepts of data. Often a carefully chosen data structure will allow the most efficient algorithm to be used. The choice of the data structure often begins from the choice of an abstract data type. A welldesigned data structure allows a variety of critical operations to be performed, using as few resources, both execution time and memory space, as possible. Data structures are implemented by a programming language as data types and the references and operations they provide. At the lowest level, there are data structures supplied and supported by the CPU (or computer chip), itself. Sikkim Manipal University

Page No. 140

C Programming and Data Structures

Unit 8

At the second level of the data structures spectrum are the data structures supported by particular programming languages. These vary a lot from language to language. Definition: A data structure is a representation of data and the operations allowed on that data. A specification, application and implementation are the view of a collection of one or more items of data, and the operations necessary and sufficient to interact with the collection. The specification is the definition of the data structure as an abstract data type. The specification forms the programming interface for the data structure. The application level is a way of modeling real-life data in a specific context. It is happening especially for the memory management. Objectives: At the end of this unit, you will be able to: present a brief idea of Data Structure. explain Abstract Data Type . explain different types of Data Structures. describe the applications of Data Structures.

8.2 Examples of Data Structure The following is a list of data structures used in application systems: a) array b) stack c) queue d) linked list e) binary tree Sikkim Manipal University

Page No. 141

C Programming and Data Structures

f)

Unit 8

hash table

g) heap h) graph Data structures are often used to build databases. Typically, data structures are manipulated using various algorithms.

8.3 Abstract Data Types (ADT) In computing, an abstract data type (ADT) is a specification of a set of data and the set of operations that can be performed on the data. Such a data type is abstract in the sense that it is independent of various concrete implementations. The definition can be mathematical, or it can be programmed as an interface. A first class ADT supports the creation of multiple instances of the ADT, and the interface normally provides a constructor, which returns an abstract handle to new data, and several operations, which are functions accepting the abstract handle as an argument. When primitive data types are not sufficient to handle the data, we have to define some data type along with its activities, storage structures and algorithms. The ADT is the data type which has the following components: 1) Operations: Specifications of external appearance of a data structure. 2) Storage Structures: Organizations of data implemented in lower-level data structures. 3) Algorithms: Description on how to manipulate information in the storage structures to obtain the results defined for the operations.

8.4 Levels of Data Structure The Abstract Level The abstract (or logical) level is the specification of the data structure - the "what" but not the "how". At this level, the user or data structure designer is Sikkim Manipal University

Page No. 142

C Programming and Data Structures

Unit 8

free to think outside the bounds of any programming language. For instance, a linear list type would consist of a collection of list nodes such that they formed a sequence. The operations defined for this list might be insert, delete, sort and retrieve. The Application Level At the application or user level, the user is modeling real-life data in a specific context. In our list example we might specify what kinds of items were stored in the list and how long the list is. The context will determine the definitions of the operations. For example, if the list was a list of character data, the operations would have a different meaning than if we were talking about a grocery list. The Implementation Level The implementation level is where the model becomes compiling and generates executable code. We need to determine where the data will reside and allocate space in that storage area. We also need to create the sequence of instructions that will cause the operations to perform as specified.

Abstract Level

Application Level

Implementation Level

Data Structure Level Diagram Fig. 8.1 Sikkim Manipal University

Page No. 143

C Programming and Data Structures

Unit 8

8.5 Types of Data Structure There are two types of data structures a) Linear Data Structure A data structure is said to be linear if its elements form a sequence or a linear list. Examples: •

Arrays



Linked Lists



Stacks



Queues

Fig. 8.2

Sikkim Manipal University

Page No. 144

C Programming and Data Structures

Unit 8

Fig. 8.3

Fig. 8.4

Fig. 8.5

b) Nonlinear Data Structure A data structure is said to be nonlinear if its elements cannot form a sequence or a linear list.

Sikkim Manipal University

Page No. 145

C Programming and Data Structures

Unit 8

Examples: •

Trees



Graphs

Pictorial Representation of Tree

Fig. 8.6

Pictorial Representation of Graph

Fig. 8.7

Sikkim Manipal University

Page No. 146

C Programming and Data Structures

Unit 8

8.6 Applications of Data Structure Traversal: Travel through the data structure, travelling salesman problem, shortest path problem. Search: Traversal through the data structure for a given element, appropriate

searching

methodology,

searching

a

number

from

thousands of random numbers. Insertion: Adding new elements to the data structure, constructing index tree, B-tree, insertion of elements into the sorted database. Deletion: Removing an element from the data structure, garbage collection, memory utilization and optimization. Sorting: Arranging the elements in some order, appropriate sorting method for appropriate architecture. Merging: Combining two similar data structures into one Examples: 1.

Adding of two large numbers.

2.

Finding shortest path between two cities among number of paths.

3.

Designing of Integrated Circuit (IC).

4.

Preparation of game planning / meeting conduction with a number common members in minimum durations.

5.

Searching of records from large database.

6.

Data mining application.

7.

Execution of large file in relatively very small memory.

8.

Managing of Dead Lock situation of Operating System.

9.

Selection of Routing path in Network & Mobile Communication.

10.

Resource utilization of Operating System.

Sikkim Manipal University

Page No. 147

C Programming and Data Structures

Unit 8

8.7 Summary A data structure is a representation of data and the operations allowed on that data. The proper choice of a data structure can lead to more efficient programs. In computer science, a data structure is a way of storing data in a computer so that it can be used efficiently. It is an organization of mathematical and logical concepts of data. Often a carefully chosen data structure will allow the most efficient algorithm to be used. A well-designed data structure allows a variety of critical operations to be performed, using as few resources, both execution time and memory space, as possible. Abstract Data Type, This unit covers the concept of data structure. Self Assessment Questions 1. A data structure is a representation of data and the operations allowed on that data.

(True / False)

2. Array is an example of data structure.

(True / False)

3. ADT means Advance Data Type.

(True / False)

4. Tree is the linear data structure.

(True / False)

8.8 Terminal Questions 1. What is a Data Structure? 2. Define Abstract Data Type. 3. Differentiate between linear and nonlinear data structure. 4. How many levels are there in Data Structure? Describe.

8.9 Answers to Self Assessment and Terminal Questions Self Assessment Questions 1. True 2. True 3. False 4. False Sikkim Manipal University

Page No. 148

C Programming and Data Structures

Unit 8

Terminal Questions 1. Section 8.1 2. Section 8.3 3. Section 8.5 4. Section 8.4

Sikkim Manipal University

Page No. 149

Unit 8 Overview of Data Structure

The following is a list of data structures used in application systems: ... h) graph. Data structures are often used to build databases. Typically, data structures.

155KB Sizes 0 Downloads 261 Views

Recommend Documents

structure of unit test - APSCERT
projector which is there in our Science Lab was donated by Radhakrishna. Really. Radhakrishna is a great teacher. ..... (ii) My house is not big enough. ( ) (B) who always help me. (iii) He stopped his business ..... (b) Narrate the thoughts of the B

structure of unit test -
Which incident in this text is funny? What makes it funny? 2. What do you learn the life of Nick Vujicic? 3. What made Nic choose Bethany Hamilton as his teacher to learn surfing? 4. What did Socrates suggest as the secret to success? Do you agree or

Unit III - Structure & Function of Government - Bureaucracy.pdf ...
Page 1 of 2. AP US Government – Exam Study Guide. Unit III: Structure & Function of Government. BUREAUCRACY. 1. What is the size of the federal bureaucracy? How is it organized and what role does it play in. making and implementing public policy? 2

Unit-8 Role of Bureaucracy.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Unit-8 Role of ...

unit 20 overview of future trends in compensation ... - eGyanKosh
the relative ranking of the given company or industry as compared with other companies or ` industries. As economic conditions change, relationship also change. A number of factors such as maturity of an industry, the stage of the business cycle, uni

UNIT 8 COMPARISONS.pdf
UNIT 8 COMPARISONS.pdf. UNIT 8 COMPARISONS.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying UNIT 8 COMPARISONS.pdf. Page 1 of 2.

Structure of driving unit in drum type washing machine
Jan 28, 2003 - EP application-related communication dated Apr. 22, 1998. 4,900,957 A ..... circle even if the rotor 13 rotates at a high speed. And, there is.

unit 16 functions and structure of ad agency
When clients and agencies advertise to "keep their brand presence in the market" or "to ..... apples for their family but will select only the best apples. 8). Make a ...

Course Name: Data Structure
To be able to understand the concepts of Database Programming, using JDBC. ... Integrating Servlets and JSP in a Web Application (MVC Architecture for Web ...

unit 1 organisation and structure of voluntary ...
technical qualifications suitable to particular official positions. Check Your ..... can be classified as business concerns and nonprofit organisations. Similarly ... any formal organisation: members or rank-and-file participants; owners or managers;

Course Overview - Year 8 Humanities.pdf
Course Overview - Year 8 Humanities.pdf. Course Overview - Year 8 Humanities.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Course Overview ...

Unit 8 Percent Review.pdf
You have a coupon for a 40% dis- count at Dillard's, and you want to buy a. $40 pair of shoes. How much will you save?_____. What is your new price?______.

Math 8 Unit 2 Overview.pdf
Teaching videos made by Wake County teachers. WCPSS YouTube Channel – Math Playlist. Repeating Decimals Overview. Converting Overview. Real Numbers Overview. Repeating Decimals Practice. Fractions to Decimals Practice. Decimals to Fractions Practic

Unit Day 8 Ferris Wheel.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Unit Day 8 Ferris ...

Math 8 Unit 7 Overview.pdf
Math 8 Unit 7 Overview.pdf. Math 8 Unit 7 Overview.pdf. Open. Extract. Open with. Sign In. Main menu. Displaying Math 8 Unit 7 Overview.pdf. Page 1 of 1.

WH - Unit 8 Dr Seuss.pdf
Page 1 of 2. Dr. Seuss's French Revolution: A Storybook about the Biggest Rev. in the World! Many people do not understand the events of the French Revolution or why it was. significant to the people and government of France, and indeed, all of Europ

Math 8 Unit 1 Overview.pdf
Manejo da Atopia em Cães. Figura 3. Cão atópico portador de dermatite. paquidermática de Malassezia. Figura 4. Vista otoscópica de mudanças hiperplásticas. iniciais dentro do canal auditivo externo. Whoops! There was a problem loading this pag

Unit Day 8 Ferris Wheel.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. Unit Day 8 Ferris Wheel.pdf. Unit Day 8 Ferris Wheel.pdf. Open. Extract. Open with. Sign In. Main menu.

Unit 8. Health and disease.
6) Define shortly the four external defences. 7) What are the cells responsible for non specific defences? 8) Who produces antibodies? 9) How do antibodies work? 10) Make a list of healthy habits for preventing infectious diseases: 11) How vaccinatio

Course Name: Data Structure - WordPress.com
To be able to create web pages using HTML and Javascript. • To be able to ... 2. Servlet Basics, Basic Servlet structure, Servlets Generating text/html content ...

Data Structure MCQs.pdf
Solved Multiple Choice Questions of Data Structure. For more MCQs of ... B) Storage Structures. C) Algorithms ... Main menu. Displaying Data Structure MCQs.pdf.

Math 6+ Unit 5 Overview .pdf
Whoops! There was a problem loading more pages. Retrying... Math 6+ Unit 5 Overview .pdf. Math 6+ Unit 5 Overview .pdf. Open. Extract. Open with. Sign In.Missing:

Teaching About the Hydrosphere Unit Overview - Semantic Scholar
The goal of this unit is to provide an introduction to the Earth's hydrologic system .... and is meant to approximate the depth profile of the Great Lakes System.