Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Other

CS 2 Exam Review

Rating
-
Sold
-
Pages
3
Uploaded on
06-12-2025
Written in
2025/2026

CS 2 Exam Review Notes

Institution
Utrgv

Content preview

1. You are asked to design a function that removes duplicates from a
singly linked list. In plain English describe how you could break this
problem down into simpler subtasks before writing code.
2. The definition of the ‘new’ operator
3. Which XXX will avoid a memory leak:

#include <iostream>

Using namespace std;

Class myClass{

Public:

myClass();

int value;

private:

int* ptr;

};

myClass::myClass(){

ptr = new int;

*ptr = 0;

Delete ptr;

}

Int main(){

Int value = 100;

Int* ptr = new int;

///XXX

Ptr1 = &value;

4. Which statement properly frees the dynamically allocated array below:
a. Musketeer* musketeers = new Musketeer[8];
5. You have the following doubly-linked list. Each node has a data(char),
as well as prev and next Node pointers. Create a new Node with the
value ‘z’ and replace thisNode with your new Node. For this exercise,
you will not overwrite thisNode’s data. Instead, you will connect your

Document information

Uploaded on
December 6, 2025
Number of pages
3
Written in
2025/2026
Type
OTHER
Person
Unknown
$9.19
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
susie3

Get to know the seller

Seller avatar
susie3 Utrgv
View profile
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
6 months
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions