Save
Data Structures Midterm
Save
Share
Learn
Content
Leaderboard
Learn
Created by
Reo Day
Visit profile
Cards (33)
What is an Array List?
A
dynamic
data structure built on top of an
array
.
View source
How does resizing an Array List work?
It creates a new
underlying
array and copies
elements
from the old one.
View source
What must all elements in an Array List have in common?
All elements must be the same
data type
.
View source
What does the capacity of an Array List refer to?
The maximum size of the
underlying
array.
View source
What are some examples of List declarations in C#?
List<
decimal
> monies;
List<
byte
[]> buffers;
List<List<List<
int
>>>
View source
What is the accuracy level of a Float data type?
Close
to
accurate.
View source
How accurate is a Double compared to a Float?
Twice
as
accurate
as
floats.
View source
When is the Decimal data type typically used?
Often used for
monetary
values due to its high precision.
View source
What is the syntax for a basic For Loop in C#?
for(int i=0; i<10; i++) {
Console.WriteLine
(i); }
View source
How can you modify a For Loop to step by 10?
for(int i=0; i<10;
i += 10
) {
Console.WriteLine
(i); }
View source
What is the purpose of a For Each Loop?
It avoids
off-by-one errors
when iterating through a collection.
View source
What is the basic operation of Bubble Sort?
It compares an element with surrounding elements and moves the
largest
to the end.
View source
What is the runtime complexity of Bubble Sort?
O(n²)
View source
How does Selection Sort operate?
It finds the
minimum
element in the
unsorted
portion and swaps it with the first unsorted element.
View source
What is the runtime complexity of Selection Sort?
O(n²)
View source
What does Insertion Sort do?
It compares two
elements
and
swaps
them if they are not in order.
View source
Why is Insertion Sort considered the fastest among simple iterative sorts for small n?
It efficiently sorts elements by building a sorted array one element at a time.
View source
How does Quick Sort function?
It divides the
array
around a
pivot
and recursively sorts the sub-arrays.
View source
What is the runtime complexity of Quick Sort?
O(n log n)
View source
How does Merge Sort operate?
It divides the input array into two halves, sorts each half
recursively
, and merges them back together.
View source
What is the runtime complexity of Merge Sort?
O(n log n)
View source
What are the types of testing in software development?
Unit Testing
: Tests individual units (
methods
).
Integration Testing
: Ensures compatibility between
systems
.
Performance Testing
: Measures
resource
usage (CPU, memory, etc).
Acceptance Testing
: Validates if the correct
product
was built.
View source
What does LIFO stand for in the context of a Stack?
Last In First Out
.
View source
What are the main operations of a Stack?
Push
,
Pop
,
Peek
.
View source
What does FIFO stand for in the context of a Queue?
First
In
First
Out.
View source
What are the main operations of a Queue?
Enqueue
,
Dequeue
,
Peek
.
View source
What is a Deque?
A hybrid of
stack
and
queue
.
View source
What is a Singly Linked List?
A linked list that contains a pointer to the next
node
.
View source
What is a Doubly Linked List?
A linked list that contains pointers to both
next
and
previous
nodes.
View source
What is a Circular Linked List?
A linked list where the last node points back to the
head
.
View source
What is the structure of a Circular Node in C#?
Class
CircularNode
<T> { Public T data; Public CircularNode next; Public CircularNode
prev
; }
View source
How do you remove a node from a linked list?
ToRemove.
prev
.
next
= ToRemove.next; ToRemove.next.prev = ToRemove.prev;
View source
What are the key characteristics of linked lists?
Singly Linked
: Pointer to next node.
Doubly Linked
: Pointers to next and previous nodes.
Circular Linked List
: Last node points back to the head.
Circular Doubly Linked List
: Combines both features.
View source