DSA part 2 PRELIM Flashcards
Focusing on what it does and ignoring how it does it’s job
(ADT) Abstract Data types
These are high-level
data structures that are defined by their behavior and
the operations that can be performed on them, rather
than by their implementation details.
Abstract Data Types (ADT)
When we consider a primitive type, we are referring to two
things: a data item with certain characteristics and the permissible
operations on that data.
Data Type
The word abstract in our context stands for
“considered apart from the detailed specifications or
implementation”.
Abstract
is a fundamental data structure used to store a
fixed-size, ordered collection of elements, all of which must
be of the same data type
Array
Characteristics of Arrays in Java
- Fixed Size
- Initialization
- Immutable Size
Once an array is created, its size is
fixed and cannot be changed. You must
specify the size of the array at the time of
declaration.
Fixed Size
After declaring an array, you can initialize its
elements individually. However, you must ensure that you do
not access or modify elements beyond the specified size of the
array.
Initialization
Once an array is created, you
cannot change its size.
Immutable Size
• A one-dimensional array is a linear collection of elements of the same
data type.
• Elements in a one-dimensional array are indexed using a single index.
• Commonly used to represent lists of data.
One-Dimensional Arrays
• Multi-dimensional arrays are arrays of arrays, that allow you to
organize data in multiple dimensions or rows and columns.
• In Java, two-dimensional arrays are the most common form of multidimensional arrays.
• Elements in multi-dimensional arrays are accessed using multiple
indices.
• Used to represent grids, matrices, tables, and more complex data
structures.
Multi-Dimensional Arrays
is a linear data structure in which
elements, called nodes, are connected sequentially via
references or links. Each node contains two parts: the
data and a reference (or link) to the next node in the
sequence.
Linked list
can be implemented in Java using classes
and references.
Linked list
Common Types of Link Lists
- Singly linked list
- Doubly linked list
- Circular linked list
has one pointer in each node pointing to the next
node in the list
Singly link list