It does not matter how slowly you go as long as you do not stop.
--Your friends at LectureNotes

Note for Data Structure and Algorithms - DSA by Aakash Sharma

  • Data Structure and Algorithms - DSA
  • Note
  • Uploaded 3 months ago
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-1

Data Structures and Algorithms (CS 2001) KALINGA INSTITUTE OF INDUSTRIAL TECHNOLOGY School of Computer Engineering Strictly for internal circulation (within KIIT) and reference only. Not for outside circulation without permission 4 Credit Lecture Note

Text from page-2

Chapter Contents 2 Sr # Major and Detailed Coverage Area 2 Hrs Arrays 5 Arrays, Abstract Data Type, Dynamically Allocated Arrays, Polynomials, Two-dimensional Array, Address Calculation, Matrix Addition and Multiplication, Sparse Matrix, Upper & Lower Triangular Matrix, Tridiagonal Matrix School of Computer Engineering

Text from page-3

Arrays 3 Data Structures are classified as either Linear or Non-Linear.  Linear data structure: A linear data structure traverses the data elements sequentially, in which only one data element can directly be reached. Ex: Arrays, Linked Lists  Non-Linear data structure: Every data item is attached to several other data items in a way that is specific for reflecting relationships. The data items are not arranged in a sequential structure. Ex: Trees, Graphs Arrays Array is a container which can hold fix number of items and these items should be of same type. Following are important terms to understand the concepts of Array. Arrays are of one-dimensional or multi-dimensional (i.e. 2 or more than 2)  Element − Each item stored in an array.  Index − Each location of an element in an array has a numerical index which is used to identify the element. School of Computer Engineering

Text from page-4

One-Dimensional Array 4 One-Dimensional array is also called as linear array and stores the data in a single row or column. Index starts with 0  Array length/size/range is 10 (i.e. 9 – 0 + 1) which means it can store 10 elements.  Each element can be accessed via its index. For example, we can fetch element at index 6 as 27.  Address (array[6]) = 100 + 2 * (6 – 0) = 112 ?  School of Computer Engineering

Lecture Notes