Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Study Guide for Homework 3 | Data Structure and Algorithms | CS 303, Assignments of Computer Science

Material Type: Assignment; Class: Algorithms and Data Structures; Subject: Computer Science; University: University of Alabama - Birmingham; Term: Spring 2008;

Typology: Assignments

2009/2010

Uploaded on 04/12/2010

koofers-user-q9f-1
koofers-user-q9f-1 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS 303L Data Structure and Algorithm
February 7, 2008
Homework 3
(Due on February 14, 2008)
1. Please select from one of the following answers for the questions listed below:
a. 𝑂(1)
b. 𝑂(𝑛)
c. 𝑂(log 𝑛)
d. 𝑂(𝑛log 𝑛)
e. 𝑂(𝑛2)
f. None of the above.
(1) The time complexity of finding the maximum value in a single-linked list of integers
sorted in ascending order.
(2) The time complexity of finding the maximum value in a single-linked list of integers
sorted in descending order.
(3) The time complexity of finding the maximum value in a double-linked list of integers
sorted in ascending order.
(4) The time complexity of finding the maximum value in an unsorted double-linked list
of integers.
(5) The time complexity of removing the last element of a double-linked list without a
tail pointer.
(6) What is the worst case time complexity of searching for an item in a sorted array
using binary search?
(7) The time complexity of finding the minimum value is a complete binary minimum
heap.
(8) The time complexity of inserting an element to a heap tree with n nodes.
(9) The time complexity of building a heap tree with n nodes by insertion method.
(10) The time complexity of giving a key to find a value stored in the hash.
pf3

Partial preview of the text

Download Study Guide for Homework 3 | Data Structure and Algorithms | CS 303 and more Assignments Computer Science in PDF only on Docsity!

February 7, 2008

Homework 3

(Due on February 14, 2008)

  1. Please select from one of the following answers for the questions listed below: a. 𝑂(1) b. 𝑂(𝑛) c. 𝑂(log 𝑛) d. 𝑂(𝑛 log 𝑛) e. 𝑂(𝑛^2 ) f. None of the above.

(1) The time complexity of finding the maximum value in a single-linked list of integers sorted in ascending order. (2) The time complexity of finding the maximum value in a single-linked list of integers sorted in descending order. (3) The time complexity of finding the maximum value in a double-linked list of integers sorted in ascending order. (4) The time complexity of finding the maximum value in an unsorted double-linked list of integers. (5) The time complexity of removing the last element of a double-linked list without a tail pointer. (6) What is the worst case time complexity of searching for an item in a sorted array using binary search? (7) The time complexity of finding the minimum value is a complete binary minimum heap. (8) The time complexity of inserting an element to a heap tree with n nodes. (9) The time complexity of building a heap tree with n nodes by insertion method. (10) The time complexity of giving a key to find a value stored in the hash.

February 7, 2008

  1. Assume that a binary tree is built for storing a set of integer values as shown below: Note : A set indicates a collection of distinct values.

A

(1) What is (are) the possible value(s) for the root A? (2) What is (are) the value(s) for the leaves? (3) If a new node with value 54 is inserted, where the node will be placed? (4) What will you obtain if performing the following operations? a. root.getLeftNode().getLeftNode().getRightNode() b. root.getRightNode().getRightNode().getLeftNode()