1.0 Lecture 1 Data Structures.pdf - DATA STRUCTURES Data...

This preview shows page 1 - 6 out of 21 pages.

DATASTRUCTURES
Data StructuresRepresenting information isfundamentalto computer science. The primary purpose of most computerprograms is not to perform calculations, but tostoreandretrieveinformation as fast as possible.A data structure can be described as a way oforganizingandstoringdata so thatoperationscan beperformedefficiently.What kind of operations are we talking about?inserting,deleting,finding,sortingetc.Given sufficient space to store a collection of data items, it is always possible to process the data items in anydesired order, or modify the value of any particular data item.
Data StructuresConsider student numbers (integers) stored in an array of length 7.We thus have the indexes asx[0], x[1], x[2], x[3], x[4]which aid in performing operation:i.Traverse −print all the array elements one by one.ii.Insertion −Adds an element at the given index.iii.Deletion −Deletes an element at the given index.iv.Search −Searches an element using the given index or by the value.v.Update –Updates an element at the given index094565678312347833548750650123451117770123456
Data StructuresUsing the proper data structure can make the difference between a program running in a fewseconds and one requiring many days. A solution is said to beefficientif it solves the problemwithin the required resource constraints (cost).It is crucial to keep thecostin mind when selecting a data structure to use in program. In thisregard the following steps are to be adhered to:i.Analyze the problem to determine the basic operations that must be supported.ii.Quantify the resource constraints for each operation.iii.Select the data structure that best meets these requirements.The first concern is for thedataand theoperationsto be performed on them, the next concern istherepresentationfor those data, and the final concern is theimplementationof thatrepresentation.
Classification of Data StructuresData StructuresNon-PrimitivePrimitiveFloatLinearNon- LinearBooleanIntegerCharTreesGraphsStacksLinked ListsQueuesArrays

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 21 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Spring
Professor
N/A
Tags
Computer program, Type system, Array data structure

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture