100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

Quiz

Rating
-
Sold
-
Pages
6
Grade
A+
Uploaded on
14-01-2021
Written in
2020/2021

Exam of 6 pages for the course Data Structures at Comsats Institute Of Information And Technology (Entire quiz)

Institution
Course

Content preview

Computer Science Foundation Exam

December 19, 2008

Computer Science

Section 1B

Name: Solution and Grading Criteria

SSN:

Max Type Passing Student
Pts Threshold Score
Q1 10 ANL 7
Q2 10 DSN 7
Q3 10 ANL 7
Q4 10 DSN 7
Q5 10 ANL 7
Total 50 35

You must do all 5 problems in this section of the exam.
Partial credit cannot be given unless all work is shown and is readable.
Be complete, yet concise, and above all be neat. Do your rough work on
the last page.




1

, 1) (10 points) Order Notation

Indicate the time complexity in terms of Big-O and the appropriate variables for each of
the following operations:

a) Using mergesort to sort n integers. O(nlgn)



b) Pushing n items on to an initially empty stack. O(n)


c) Searching for an element in a sorted array of n elements O(lgn)
using a binary search (worst case)


d) Searching for an element in a sorted array of n elements O(1)
using a binary search (best case)


e) Searching for an element in a sorted array of n elements O(n)
using a linear search (worst case)


f) Converting an infix expression with n symbols to a postfix O(n)
expression using the standard algorithm


g) Inserting n elements into an initially empty AVL tree O(nlgn)
(worst case)


h) Inserting n elements into an initially empty BST that does O(n2)
not enforce balance properties (worst case)


i) Adding two n digit numbers together using the standard O(n)
addition algorithm you were taught in elementary school


j) Performing a postfix traversal of a binary tree containing n O(n)
elements

Grading: 1 pt each, all or nothing. Accept answers that are correct within a constant
factor.




2

Written for

Institution
Course

Document information

Uploaded on
January 14, 2021
Number of pages
6
Written in
2020/2021
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$7.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
youtubecanvas

Get to know the seller

Seller avatar
youtubecanvas COMSATS Institute Of Information Technology
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
5 year
Number of followers
0
Documents
18
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Trending documents

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions