0% found this document useful (0 votes)
81 views1 page

Data Structures and Algorithms Exam 2024

Uploaded by

www.infas7771
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views1 page

Data Structures and Algorithms Exam 2024

Uploaded by

www.infas7771
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

‭HNDIT3032 - Data‬‭S‭t‬ructure and Algorithm‬

‭Post Midterm Examination‬‭2‬‭3.11.2024‬


‭Duration:‬‭90‬‭Minutes‬ ‭Index No:_________________‬

‭Answer‬‭all‬‭questions and‬‭number‬‭them correctly. Please‬‭return‬‭this paper upon completion.‬

‭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.e‬‭0, 1, 1, 2, 3, 5, 8, 13,‬
‭21, 34, 55)‬
‭c.‬ ‭What is‬‭Time Complexity‬‭, and why is it important in‬‭analysis of‬
‭algorithms?‬
‭d.‬ ‭Define an array data structure and explain whether it is resizable or not?‬

‭2.‬
‭ .‬ C
a ‭ ompare‬‭Array‬‭and‬‭ArrayList‬‭in terms of their structure,‬‭performance‬
‭b.‬ ‭Explain the LIFO nature based on‬‭Push‬‭,‬‭Pop‬‭, and‬‭Peek‬‭operations in a‬
‭Stack‬
‭c.‬ ‭Explain the‬‭Front‬‭and‬‭Rear‬‭pointers in a‬‭Queue‬‭, and‬‭explain 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 I‭nsertion‬ ‭ election‬
S ‭ ubble‬
B
‭list‬ ‭Search‬ ‭Search‬ ‭Search‬ ‭Sort‬ ‭Sort‬ ‭Sort‬
‭Tree‬

‭Insert‬

‭ earch/‬
S
‭Sort‬

‭Delete‬

You might also like