CSE240 FINAL EXAM QUESTIONS AND ANSWERS WITH COMPLETE SOLUTIONS 100% GUARANTEED PASS
5 views 0 purchase
Course
CSE240
Institution
CSE240
CSE240 FINAL EXAM QUESTIONS AND ANSWERS WITH COMPLETE SOLUTIONS 100% GUARANTEED PASS
Which C/C++ operations will acquire memory from heap?
malloc
new
You DO NOT need to garbage-collect the memory, if it comes from (Select all that apply)
stack memory
static memory
global memory
NOT heap m...
cse240 final exam questions and answers with compl
Written for
CSE240
All documents for this subject (20)
Seller
Follow
AcademicSuperScores
Reviews received
Content preview
CSE240 FINAL EXAM QUESTIONS AND ANSWERS WITH
COMPLETE SOLUTIONS 100% GUARANTEED PASS
Which C/C++ operations will acquire memory from heap?
malloc
new
You DO NOT need to garbage-collect the memory, if it comes from (Select all that
apply)
stack memory
static memory
global memory
NOT heap memory
How is Java's garbage collection implemented?
It uses a reference counter to indicate if an object is still referenced by any variable
What is the key difference between a static variable and a global variable?
They have different visibility
Given the snippet of code:
int x = 5;
int bar(int j){
int *k = 0, m = 5;
k = &m;
return (j+m);
, }
void main(void){
static int i = 0;
i++;
i = bar(i) + x;
}
Which variables obtain their memory from the stack? Select all that apply
m
j
k
What is the best way of deleting an array created by "p = new StructType[size];"
in C++?
delete[] p;
What is the best way of deleting a linked list of objects in C++?
Use a loop to delete every object in the linked list
What is the best way of deleting all the nodes in a binary tree pointed to by the
root pointer?
Traverse the tree and delete each node individually
A piece of memory must be explicitly garbage-collected, if it comes from
heap
If A is the base class and B is a class derived from A, then
class B has all the members of class A
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller AcademicSuperScores. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $9.99. You're not tied to anything after your purchase.