Hndit 2
Hndit 2
1.
. D
a efine data structure and contrast with Abstract Data types ?
b. Write a Java method or pseudocode to calculate the nth Fibonacci
number.
(Hint: The Fibonacci sequence starts with 0 and 1, and each subsequent
number is the sum of the previous two numbers. I.e0, 1, 1, 2, 3, 5, 8, 13,
21, 34, 55)
c. What isTime Complexity, and why is it important inanalysis of
algorithms?
d. Define an array data structure and explain whether it is resizable or not?
2.
. C
a ompareArrayandArrayListin terms of their structure,performance
b. Explain the LIFO nature based onPush,Pop, andPeekoperations in a
Stack
c. Explain theFrontandRearpointers in aQueue, andexplain FIFO nature
d. Diagramatically Show the insertion of following dataset in binary search
tree
50, 35, 70, 20, 45, 60, 80, 10, 75, 60.
3.
.
a hat is sequential search, explain with characteristics.
W
b. Write a java code for sequential search?
c. Insertion sort is better than bubble sort, do you agree? Justify your answer
d. List down the time complexity for considering the worst case scenario
Operation Array Arraylist inked
L Stack Queue inary
B equential
S inary
B Insertion election
S ubble
B
list Search Search Search Sort Sort Sort
Tree
Insert
earch/
S
Sort
Delete