CSCI 103 - Spring 2025 Introduction to Programming

MT2 Info

Overview and Process

Time/Date: Thurs, Apr. 3rd at 7 PM Pacific Pacific - 90 minutes (End at 8:30 p.m.).

Disallowed seating

THH 101THH 201THH 102

Topics

The following is the list of topics that you should be familiar with. Use it as a guide to help your studying.

Unit 3a

Unit 3b

Unit 4a

Unit 4b

Unit 4c

Unit 4d

Unit 4e

Unit 4f

Summary of Important Topics: All the topics from MT1 and prior assignments are also still requisite knowledge but the majority of the focus will be on the topics listed above. Be sure you are very comfortable with:

Other topics that you should be familiar with:

Practice Problems

Simple Tasks You Should Be Able To Do

File I/O and Arrays: Assume an input file with data values (strings or ints) separated by whitespace. Assume the first item in the list IS an integer of how many more items will appear. Read in all of the data items (after the first integer) and print them out in reverse order. Check to ensure each item was read successfully and quit if any item fails to be read correctly (e.g. if a string appears in the file of ints).

Sample Linked List Coding

On Brightspace..Content..MT2 Practice And Exam Prep, you will find links to TWO linked-list coding problems representative of what we would expect on the exam. The problem descriptions are given below (not in Codio). On the exam, the problem descriptions will likely be given on a paper exam. Start by writing your program in Codio and using the provided main() with some basic tests you can edit and modify, as well as some automated tests. Please note: that on the exam passing any automated tests is a good sign your code works but NOT a guarnatee. There may be edge cases our tests do not exercise and that you need to account for. Or you may have not followed the restrictions or guidelines we gave, which would then lead to partial or no credit, even though you passed the tests.

Reorder Halves:

Given a linked list with n nodes, update the appropriate links such that the linked list will be modified so that nodes at logical index n/2 to n-1 are moved to the front of the list and nodex at logical index 0 to n/2-1 are moved to the end (thus, reordering the halves).

Find And Move:

Given the value, x, find the first occurrence of x in the list and move it to the back of the list (by reordering links…you cannot just change values) then return true. If x does NOT occur in the list, return false.

STRONG RECOMMENDATION: Do NOT look at these solutions until you have fully solved the problem on your own. If you struggle and cannot get the code to work, go get help from course staff or another student. Don’t ask chatGPT, don’t look at the solutions. Only by struggling until you get it working, will you likely learn what you need to do these on your own.

Sample MT2 (Gradescope and Codio)

Spring 2023 MT2 (Codio)

Review Linked-List and Vector Lab

Many of the coding problems in that lab are (will be) useful to prepare for the MT2.