0% found this document useful (0 votes)
5 views

BCA Data Structures Notes

This document introduces the concept of data structures, emphasizing their importance in programming and algorithm development. It discusses the need for understanding various data structures like arrays, stacks, queues, lists, and binary trees, as well as the goals of data structures including correctness, efficiency, robustness, adaptability, and reusability. The document highlights that a well-constructed data structure is crucial for effective data representation and manipulation in programming.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

BCA Data Structures Notes

This document introduces the concept of data structures, emphasizing their importance in programming and algorithm development. It discusses the need for understanding various data structures like arrays, stacks, queues, lists, and binary trees, as well as the goals of data structures including correctness, efficiency, robustness, adaptability, and reusability. The document highlights that a well-constructed data structure is crucial for effective data representation and manipulation in programming.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Introductiontodatastructures

IIIIII
a[O]a[l]a[2]a[3]a[4]
3
memoryrepresentation
1.2
Figure1.2
StorageRepresentationOfData
THENEEDFORDATA STRUCTURES
One of the tools that beginers often take for granted is the high-level language in which they
write their programs. Since most of us first learn to program in a language like C. we do not appreciateits
branching and looping structures and built-in data structures until we are later introduced to language
that do not have these features.
In the first semester(C programming). we decided to use an array of structure to store our data.
But what is an array? What is a structure? C. as well as many other hig-level programming langauges.
provides arrays and structure as built-in data structures. As a C programming. you can use these tools
without concern about their implementation. much as a car driver can use a car without knowing about
automobile technology.
However, there are many interesting and useful ways of structuring data that are not provided in
general-purpose programming languages. The programmer who wants to use these structures must build
them. Inthisbook,wewilllookin detailfourusefuldatastructures:stacks,queues,listsandbinarytrees. We will
decribe each of these structures and design algorithms to manipulate them. We will build them using the
tools that are available in the C language. Finally, we will examine applications where each is
appropriate.
First,however, we will develop a definition of data structure and an approach that we can use to
examine data structures. By way of example, we will apply our definition and approach to familiar Cdata
structures: the one dimensional array, the two dimensional array, and the structure.

The two important goals of data structures are first to identify the representation of abstract
entities and then to identify the operations. which can be performed with them. The operations help us to
determine the class of problems, which can be solved with these entities.

4Introductiontodatastructures

The choice of data model depends on two considerations. First. it must be rich
enough instructureto showtheactual relationshipsofdatainreal world.Ontheother hand, the
structure should be simple enough so that one can efficiently process the data when
necessary. Data structure is nothing but arrangement of data and their relationship and the
allowed operations. One can use simple data structure to build complex data structures.
Data structures are fundamental to computer programming in any language. As
progranuners work on algorithm development and problem analysis. they make crucial
decisions about data structures. A data structure is a representation of the data in the
program. Theproper construction ofa programisinfluencedbythechoice of datastructure.
which is used. A datastructure is a systematic wayof organizingand accessingdata, and an
algorithm is a step- by-step procedure for perfonIling some task ina tillite amount of time.
These concepts are central in computing.

1.3GOALSOFDATA STRUCTURES

Thegoalsof datastructurescanbedesignedtoanswercertainquestionssuchas

1.Doesthedatastructuredowhatitissupposedto do?
,,2.Doestherepresentationworkaccordingtotherequirementspecification,ofthetask?
~3.Isthereaproperdescriptionoftherepresentationdes;cribinghowtouse.it andhowit works?
I
Theabovequestionswhenansweredcreatethe-fundamentalgoalsthatareusedin designing
descriptions of data structures. some of them are

1.Correctness
i 2. Efficiency .,
,
.,3.Robustness,; 4.Adaptability
5. Reusability

Bycorrectness. we mean that a data structure is designed.to workcorrectly.forall


possible inputs that one might encounter. For example. a data structure that
is supposedto storea collection of numbersin order should never allow for elementsi to be
stored out of order. The precise meaning of correctness. will always depend I on the specific problem
the data structure is intended to solve. but correctness
shouldbeaprimary
goal.

Useful data structure and their operations also need to be efficient. That is, they
should be fast and not use more of the computer's resources. such as memory space. than
required. In a real-time situation, the speed of a data structure
~ operation can make the difference between success and failure, a difference that can often be quite
important.
,
--'"~"

You might also like