• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 5 pages
Exam (elaborations)

EECS 280 Final Exam Fall '18 - Term Definitions Questions and Graded Answers.

Document preview thumbnail
Preview 2 out of 5 pages

EECS 280 Final Exam Fall '18 - Term Definitions Questions and Graded Answers.

Content preview

EECS 280 Final Exam Fall '18 - Term
Definitions Questions and Graded
Answers.
The "Rule of (the Big) Three" - If you need to declare EITHER a copy constructor, assignment
operator, or destructor, then you probably need to explicitly declare ALL three.
//
Alternately: if your program has dynamically-allocated memory, you probably need to declare
all three of these.


"friend" classes - If B is a class declared inside A, declaring A as a friend class of B means A can
see B's private variables.


//Note: Friendship DOESN'T go both ways! A can't say "B is my friend" if B is inside A.


Deep copy - Copies the actual object a pointer points to, not just the pointer itself, for a new
instance of a class.


Shallow copy - A copy that replicates only a pointer-to-object, and not the object itself, for a new
instance of a class.


Destructor - A member function that deletes the dynamically-allocated memory associated with
an object instance at the end of that object's lifetime (called automatically).


Virtual destructor - A destructor that ensures the proper corresponding destruction takes place in
derived classes that may contain member variables that are different from those of the base class.

, Copy constructor - A member function of an object that takes in a current object instance,
allocates memory for a new object instance, and gives that new instance the exact same member
variables as the old instance by initializing them.


Overloaded assignment operator - Combines the functionality of destructors and copy
constructors.


*this - A "hidden" member variable of every class that points to the current/working instance of
the class in your program.


3 types of recursion - Linear recursion, tail recursion, and tree recursion


Tail recursion/tail-recursive function - A recursive function in which the recursive statement is
the last statement that occurs in the entire recursive function. Differs from linear recursion
because the recursive call MUST be last.


Linear recursion/linear-recursive function - A recursive function that only makes one recursive
call in its entire implementation. Differs from tail recursion because this call doesn't need to be
the last statement.


Tree recursion/tree-recursive function - A recursive function that makes multiple recursive calls
throughout its body.


Dangling pointer - A pointer that points to a memory location which no longer contains the
object it originally pointed to; a pointer that points to unallocated memory.


Memory leak - When a piece of dynamically-allocated memory is not properly de-allocated by
the programmer.


Consequences of memory leaks - May slow down the program, crash the program, or (at worst)
cause undefined behavior.

Document information

Uploaded on
September 4, 2025
Number of pages
5
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$4.49

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

Sold
0
Followers
0
Items
373
Last sold
-



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