100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
3358 Data Structures and Algorithms Exam I Questions and Answers $9.49   Add to cart

Exam (elaborations)

3358 Data Structures and Algorithms Exam I Questions and Answers

 5 views  0 purchase
  • Course
  • 3358 Data Structures and Algorithms
  • Institution
  • 3358 Data Structures And Algorithms

3358 Data Structures and Algorithms Exam I If two or more different functions are given the same name, that name is said to be ____________ - Answer- overloaded The name of a function can be overloaded, provided no two definitions of the function have the same __________ - Answer- signature...

[Show more]

Preview 2 out of 9  pages

  • August 18, 2024
  • 9
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • overloaded
  • signature
  • declaration
  • 3358 Data Structures and Algorithms
  • 3358 Data Structures and Algorithms
avatar-seller
Freshy
3358 Data Structures and Algorithms
Exam I
If two or more different functions are given the same name, that name is
said to be ____________ - Answer- overloaded

The name of a function can be overloaded, provided no two definitions of
the function have the same __________ - Answer- signature

The ___________ of a function is a list of the types of its parameters, including
any const and reference or pointer indicators (& or *) - Answer- signature

Why are function signatures important? - Answer- -Compiler essentially considers a
function's signature to be part of its name

-Allow compiler to distinguish ("disambiguate") calls to different functions with
the same name - make function overloading possible

-Caveat: compiler may not be able to "disambiguate" certain signature difference -
e.g.: Calc(int) vs Calc(int&) in call Calc(intVal);

Two functions with identical lists of parameter types but different return types
(can,cannot) be overloaded - Answer- cannot

Is this legal?
int Sum(int a, int b, int c = 0, int d = 0); //prototype - Answer- Yes, so long as the
function's header does not contain default arguments

Default arguments must be the (rightmost/leftmost) arguments in function's
parameter list - Answer- rightmost

Default values are specified in a function's ___________ but are not repeated in the
definition - Answer- declaration

4 important attributes associated with every variable - Answer- -name
-value stored
-address
-data type

name - Answer- identifier for referencing variable directly

address - Answer- address of first memory location allocated
for the variable

How does one determine the address of a variable? - Answer- -attach address of
operator (&) immediately in front of the variable name
--e.g.: &years (NOTE: no space between & and the variable name)

, Describe this:
int *countPtr = 0, count; - Answer- -declares countPtr to be of type int * (i.e., pointer
to int) and initializes it to 0 (more on the "zero" address to come)
-is read "countPtr is a pointer to int" or "countPtr points to an object of type int"
-also declares count to be an int (not a pointer to int!)

A pointer may be initialized to....(2 answers) - Answer- -either 0 (the only integer
value that can be assigned directly to a pointer and it can be assigned to a pointer to
any type)...
-or the address of a variable of the same type pointed to by the pointer

A pointer with a value 0 (the null address) is called the _______ - Answer- null
pointer

when there is no other appropriate address for the pointer (perhaps for the time
being) Initializing or assigning a pointer with the ________ is a way of preventing the
pointer from being improperly used - Answer- null address

int *countPtr = 0, count;
...
count = 7;
countPtr = &count;
...
How are count and countPtr related? - Answer- -count directly references a
variable whose value is 7
-countPtr indirectly references
(or points to) a variable whose
value is 7

The object-based paradigm overcomes the procedural paradigm's lack of emphasis
on data by providing a mechanism that enables programmers to
______________ - Answer- selectively restrict access to data

data encapsulation - Answer- by packaging data and associated
operations into unified entities (objects)

data/information hiding - Answer- user is shielded from data
implementation and allowed to manipulate data only through some well-defined and
well-behaved interfaces

A ____________ is a special member function of a class that is used to initialize
objects of the class as they are created - Answer- constructor

each time a class object is created (comes into existence) A ___________ is
automatically called - Answer- constructor

A _________ is called when a class object is declared without supplying any
arguments - Answer- default constructor

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

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

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

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 Freshy. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $9.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77254 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$9.49
  • (0)
  Add to cart