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
Document preview thumbnail
Preview 2 out of 9 pages
Exam (elaborations)

DATA STRUCTURES AND ALGORITHMS - EXAM 1 STUDY GUIDE UPDATED ACTUAL QUESTIONS AND CORRECT ANSWERS

Document preview thumbnail
Preview 2 out of 9 pages

DATA STRUCTURES AND ALGORITHMS - EXAM 1 STUDY GUIDE UPDATED ACTUAL QUESTIONS AND CORRECT ANSWERS

Content preview

DATA STRUCTURES AND ALGORITHMS - EXAM 1 STUDY
GUIDE UPDATED ACTUAL QUESTIONS AND CORRECT
ANSWERS

Question:
1. Abstract Data Types
Answer:
An abstract data type (ADT) is a data type whose creation and update are constrained to specific
well-defined operations.
It's described by predefined user operations, such as "insert data at rear", without indication how each
operation is implemented.

Question:
2. Abstraction v. Implementation
Answer:
Abstraction: In many languages, abstraction usually involves some sort of interface for a programmer by
using an API or library. When we write programs that use these interfaces, we often do not care about how
the function is actually implemented, but are just interested about the input and output values. In a word,
abstraction is about the overall idea.
Implementation: This is where we actually care about how something is done "under the hood". We have
to consider how our code's speed and efficiency is determined by the realities of the hardware (e.g. locality
is something that needs to be taken into account). There are usually many ways to solve a problem, and
implementation is all about which one is the best and how we do it.
The implementation can contain calls to interfaces of another API intersecting abstraction and
implementation. Figure 1 shows an example of this idea using threads as our abstraction, the pthread
library as our interface, and the chain of events that occur when calling a function like pthread_create() as
our implementation. Notice how this chain switches between interface calls and implementation details.

Question:
3. Data Structure
Answer:
A data structure is a way of organizing, storing, and performing operations on data. Operations performed
on a data structure include accessing or updating stored data, searching for specific data, inserting new
data, and removing data. *see list of basic data structures

Question:
4. Break a class across two files
Answer:
Typical two files per class:
ClassName.h Contains the class definition, including data members and member function declarations.
ClassName.cpp Contains member function definitions.

, Question:
5. .hpp file
Answer:
Header files should contain function declarations for functions defined in another file.




Question:
6. .cpp file
Answer:
Cpp files should contain function definitions for functions declared in another file.




Question:
7. Why guard an .hpp file?
Answer:
Header file guards are preprocessor directives, which cause the compiler to only include the contents of the
header file once.
Guards:
#ifndef FILENAME_H #define FILENAME_H
//Header file contents
#endif

Question:
8. Compiling a program Modularly

Document information

Uploaded on
September 12, 2026
Number of pages
9
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

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

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
STANFORDGENIUS
4.0
(235)
Sold
1557
Followers
108
Items
113226
Last sold
4 hours ago



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