Skip to content
VUBuddy

CS311 Midterm Paper

Introduction to Web Services Development PDF 73 KBUpdated 23 Oct 2026
Midterm past paper CS311 Midterm Paper PDF 73 KB
vubuddy.com
Type
Midterm past paper
Course
CS311 Introduction to Web Services Development
Size
PDF 73 KB
Updated
23 Oct 2026
Free download 0 of 3 used today
Download free · 73 KB

You get 3 free files a day on the website. Add the Chrome extension for 30 a day.

Unlimited downloads in the Android app Get it free on Google Play

Preview text

Text from pages 1, 2, 3 of 7. Download the file for all 7 pages.

CS 311 Data Structures and Algorithms, Fall 2020

Midterm Exam

Due 2 pm Friday, October 9, 2020

Name:

The exam is worth 120 points. 7 pages (including this cover page), 8 problems.

Instructions

Answer all of the problems on the following pages.

This exam is to be done individually. You may reference an class materials, books, your own notes, or anything on the web, but not other people.

Turn in a PDF on UAF Blackboard, under “Midterm Exam” for this class. The PDF should have your name on the first page. It should be turned in by 2 pm Friday, October 9, 2020.

  1. [15 pts total] Order of Useful Operations. In each part, indicate the order of the given operation, first using Θ, and then, based on this, in words (e.g., “exponential time”). Assume that a good algorithm is used—within the constraints given. Use n to denote the number of items in the list that the algorithm is given as input. The model of computation is our usual one. 1a. [3 pts] Printing the last item in an array whose size is known.

Θ:

In Words:

1b. [3 pts] Printing the last item in a Linked List whose size is known.

Θ:

In Words:

1c. [3 pts] Finding an item with a given value in a sorted array.

Θ:

In Words:

1d. [3 pts] Sorting a Linked List.

Θ:

In Words:

1e. [3 pts] Sorting an array with Insertion Sort.

Θ:

In Words:

  1. [5 pts] Iterators & Ranges. Vector src has size 8. It contains, in order, the values 0, 10, 20, 30, 40, 50, 60, 70. The following function call copies certain items in src to vector dest. List the values of the items of src that are copied.

std::copy(begin(src)+2, begin(src)+5, begin(dest));

  1. [12 pts total] Overloaded Operators. For each of the following operators, indicate whether we should declare it as a member or a global function and how each of the parameter(s) should be passed (by value, etc.). If you wish, you may answer each part by giving a prototype. 3a. [4 pts] operator+=

3b. [4 pts] Binary operator+

3c. [4 pts] operator<< (stream output)

  1. [8 pts total] Ownership & Releasing. Give 2 examples of resources that can be owned, along with what it means to release each one. An example is given.

Example resource: An open file What it means to release the example resource: Close the file

Resource #1: · What it means to release resource #1: · Resource #2: · What it means to release resource #2:

All CS311 files →
CS311 Introduction to Web Services Development All CS311 handouts, past papers, quizzes and MCQs in one place. Open course page

Get more out of VUBuddy, for free

Android app Free on Google Play
  • Unlimited downloads
  • The explanation behind every MCQ answer
  • Study offline on slow data
Get the Android app
Chrome extension Free on the Chrome Web Store
  • 30 downloads a day instead of 3
  • Sign in and buy Pro Semester here
Add to Chrome

One Pro Semester membership works in both the extension and the app.