Unit 2-Part 1 Flashcards

Fundamental Data Structures (38 cards)

1
Q

What does a data structure provide?

A

provides organization of mathematical and logical concepts of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is data structure?

A

-Way of arranging data on a computer memory so that it can be stored, accessed, processed (updated), and retrieved efficiently

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are linear data structures?

A

-The data items are arranged sequentially ex. array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are non linear data structures?

A

data types are in an unordered sequence ex. graph

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are homogenous data structures?

A

-same type of data items
ex. data items of an array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are heterogenous data structures?

A

-Various types of data items
ex. abstract data type defined as a class specification in Java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are static data structures?

A

-Have fixed sizes, structures, and memory locations at compile time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are dynamic data structures?

A

-Have sizes, structures, and memory locations that can shrink or expand

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are examples of linear data structures?

A

-Stacks
-Queues
-Arrays
-Linked lists

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do linear data structures work?

A

-Each element is linearly connected
-Each element has a reference to the next and previous elements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How is memory used in a linear data structure?

A

-Wastage of memory is more common in linear data structures

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do non linear data structures work?

A

-The elements are connected in a hierarchical manner

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How is memory used in non linear data structures?

A

-Memory is consumed wisely
-There is almost no wastage of memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are examples of non linear data structures?

A

-Graphs
-Trees

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are applications of linear data structures?

A

-Mainly in application software development

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are applications of non linear data structures?

A

-Artificial Intelligence
-Image processing

17
Q

What is the only concrete data structure provided by Java?

18
Q

Where are arrays stored?

A

-Stored in the heap with a reference variable

19
Q

Define Searching?

A

The process of looking for a specific element inside an array

20
Q

Does Java check the boundary during compilation?

A

No only during runtime
-ArrayIndexOutOfBoundsException will appear on console if the element is not inside the array

21
Q

What is Stack?

A

Is a collection of elements inserted and removed according to the Last In, First Out
-LIFO

22
Q

The element at the last index of the array is…

A

the top of the stack

23
Q

Where do Push/Pop operations take place inside a stack?

A

At the top of the stack

24
Q

What are direct applications of Stack?

A

-Page visited history in a web browser
-Undo sequence in a text editor

25
What are indirect applications of Stack?
-Auxilliary data structures for algorithms -Component of other data structures
26
What is Queue?
-Collection of items inserted and removed according to the First In, First Out -FIFO
27
How do Queues differ from Stack?
- A queue is open on both ends -One end is used to add data -One end is used to remove data
28
What are indirect applications of Queue?
-Auxiliary data structures for algorithms -Component of other data structures
29
What are direct applications of Queue?
-Waiting Lists -Bureaucracy -Access to shared resources (ex. Printer) -Multiprogramming
30
What is a Linked list?
-A data structure where the objects are arranged in a linear order
31
How are Linked Lists different from Arrays?
-The order of a linked list is determined by a pointer in each object -Unlike the linear order of arrays are based on indices
32
What are the ways Linked Lists can be realized?
-Singly Linked List (SLL) -Doubly Linked List (DLL)
33
What is a Singly Linked List (SLL)?
-A concrete data structure consisting of a sequence of nodes -which start from a head pointer
34
What is a node?
Node store: -Element -Link to the next node via the next node's address
35
List applications of SLL
-Used to implement stacks and queues in ADT -Prevent collision between the data in the hash map -A photo viewer for displaying the photos continuously in a slide show
36
What is a Doubly Linked List?
-A list that can be traversed forward and backward
37
What do the nodes of a Doubly Linked List do?
Store: -element -Link to the previous node -Link to the next node
38
What are operations of DLL?
-In navigation systems where front and back navigation is required -back and forward Botton of web browsers