0% found this document useful (0 votes)
10 views4 pages

Array ADT Notes

An Abstract Data Type (ADT) is a logical description of a data type that defines the data and operations without detailing implementation. The Array ADT is a collection of homogeneous elements stored in contiguous memory, allowing operations such as access, insertion, and deletion. While it offers fast access and efficient memory usage, it has limitations like fixed size and costly insertion and deletion.

Uploaded by

syeda
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views4 pages

Array ADT Notes

An Abstract Data Type (ADT) is a logical description of a data type that defines the data and operations without detailing implementation. The Array ADT is a collection of homogeneous elements stored in contiguous memory, allowing operations such as access, insertion, and deletion. While it offers fast access and efficient memory usage, it has limitations like fixed size and costly insertion and deletion.

Uploaded by

syeda
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Arrays as Abstract Data Type (ADT)

Abstract Data Type (ADT) – Notes

1. Definition

An Abstract Data Type (ADT) is a logical description of a data type that


defines:

- The data

- The operations that can be performed on the data

It focuses on what operations are performed, not how they are implemented.

2. Key Characteristics

- Abstraction – Hides internal implementation

- Encapsulation – Combines data and operations

- User Interface – Only operations are visible

- Implementation Independence – Can be implemented in different ways

3. Components of ADT

(a) Data – The values stored

(b) Operations – Functions performed (insert, delete, search)


1. Definition of Array as Abstract data type

An Array ADT is a collection of elements of the same data type stored in


contiguous memory locations.

It defines data (elements) and operations such as access, insertion, deletion,


and update.

2. Characteristics of Array ADT

- Homogeneous elements

- Stored in continuous memory

- Access using index

- Fixed size

- Fast access

3. Operations on Array ADT

(a) Access – Retrieve element using index

(b) Insertion – Add element at a position (requires shifting)

(c) Deletion – Remove element (requires shifting)

(d) Traversal – Visit all elements

(e) Searching – Linear search, Binary search

(f) Updating – Modify element value

4. Representation of Array

Example: int a[5] = {10, 20, 30, 40, 50};


Index: 0 1 2 3 4

Value:10 20 30 40 50

5. Array as ADT Concept

User View:

- Store elements

- Access elements

- Insert/Delete

Implementation View:

- Memory allocation

- Index calculation

- Address mapping

6. Advantages

- Easy to use

- Fast access (O(1))

- Efficient memory usage

- Suitable for large data

7. Disadvantages

- Fixed size
- Costly insertion and deletion

- Possible memory wastage

8. Example

Array: [10, 20, 30, 40]

After insertion: [10, 20, 25, 30, 40]

9. Conclusion

Array ADT defines operations on data while hiding implementation details.

You might also like