DSA, Database System & Operating System β Data Structure, Lists, Linked Lists and Trees, NEC licence examination syllabus (Nepal Engineering Council).
Getting this vocabulary straight now saves confusion for the rest of the subject.
Data typeA classification of data (int, float, char) that tells the compiler how to interpret and store a value.
Data structureA specific way of organizing multiple pieces of data together (array, linked list, tree) so operations on them are efficient.
Abstract Data Type (ADT)A conceptual DEFINITION of a data structure's behaviour (what operations it supports) WITHOUT specifying how it's implemented internally. A stack is an ADT; the array or linked-list version of it is the actual data structure.
The three definitions are correct but the point of the ADT only lands with an example. A stack ADT is defined entirely by its behaviour:
That same ADT can be implemented two entirely different ways:
Array-backedKeep a top index. Push writes and increments; pop reads and decrements. Fast and cache-friendly, but the capacity is fixed unless it resizes.
Linked-list-backedPush adds a node at the head; pop removes it. Grows without limit, at the cost of a pointer per element and scattered memory.
A data type operates at a lower level again: it tells the compiler how many bytes a value occupies and how to interpret the bit pattern. The same 32 bits mean different numbers as an int and as a float.
So the three form a hierarchy of abstraction β data type interprets bits, data structure organises many values, ADT specifies behaviour independent of both.
int also promises operations (+, β, Γ) without your knowing whether the hardware uses two's complement or how the adder is wired. The idea is the same; only the level differs.Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.
Loadingβ¦