Unit 2-Part 1 Flashcards
Fundamental Data Structures (38 cards)
What does a data structure provide?
provides organization of mathematical and logical concepts of data
What is data structure?
-Way of arranging data on a computer memory so that it can be stored, accessed, processed (updated), and retrieved efficiently
What are linear data structures?
-The data items are arranged sequentially ex. array
What are non linear data structures?
data types are in an unordered sequence ex. graph
What are homogenous data structures?
-same type of data items
ex. data items of an array
What are heterogenous data structures?
-Various types of data items
ex. abstract data type defined as a class specification in Java
What are static data structures?
-Have fixed sizes, structures, and memory locations at compile time
What are dynamic data structures?
-Have sizes, structures, and memory locations that can shrink or expand
What are examples of linear data structures?
-Stacks
-Queues
-Arrays
-Linked lists
How do linear data structures work?
-Each element is linearly connected
-Each element has a reference to the next and previous elements
How is memory used in a linear data structure?
-Wastage of memory is more common in linear data structures
How do non linear data structures work?
-The elements are connected in a hierarchical manner
How is memory used in non linear data structures?
-Memory is consumed wisely
-There is almost no wastage of memory
What are examples of non linear data structures?
-Graphs
-Trees
What are applications of linear data structures?
-Mainly in application software development
What are applications of non linear data structures?
-Artificial Intelligence
-Image processing
What is the only concrete data structure provided by Java?
-Array
Where are arrays stored?
-Stored in the heap with a reference variable
Define Searching?
The process of looking for a specific element inside an array
Does Java check the boundary during compilation?
No only during runtime
-ArrayIndexOutOfBoundsException will appear on console if the element is not inside the array
What is Stack?
Is a collection of elements inserted and removed according to the Last In, First Out
-LIFO
The element at the last index of the array is…
the top of the stack
Where do Push/Pop operations take place inside a stack?
At the top of the stack
What are direct applications of Stack?
-Page visited history in a web browser
-Undo sequence in a text editor