{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

solmidt_02F

solmidt_02F - CS340 Fall 2002 MIDTERM EXAM(SOLUTION Malek...

This preview shows pages 1–3. Sign up to view the full content.

CS340 – Fall 2002 – MIDTERM EXAM (SOLUTION) Malek Mouhoub October 23 2002 Duration: 75min Exercise 1: Short Questions[5pts] Define the following concepts in your own words. 1. Abstract Data Type. 2. Binary Search Algorithm versus Binary Search Tree. 3. AVL Tree versus Splay Tree. 4. Worst case versus average case time complexity. 5. Polynomial versus exponential time complexity. Exercise 2: Algorithm Analysis[4pts] Order the following functions by growth rate : 3 2 n n 3 2 log n 4 logn n 3 log 2 n 1 3 n 2 log n log log n n 2 n n log n log n 2 log n n 7 3 N n 1 ! Indicate which functions grow at the same rate. Note : log : logarithm to the base 2. log n loglog log n . log 2 n = log n 2 . Solution: 7 3 N , 1 3 , log n , log log n , log n , log 2 n , n and 2 log n , n log n , n 3 2 , 4 logn , n 2 log n , n 3 , 3 2 n , n 2 n , n 1 ! .

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Exercise3: Stacks and Queues [6pts] 1. Arrays and linked lists are two fundamental data structures used to implement the different ADTs we have seen during this course. In the case of the ADT stack, discuss the advantages and disad-
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 4

solmidt_02F - CS340 Fall 2002 MIDTERM EXAM(SOLUTION Malek...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online