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 7 pages
Exam (elaborations)

ECE 206 EXAM QUESTIONS AND ANSWERS

Document preview thumbnail
Preview 2 out of 7 pages

ECE 206 EXAM QUESTIONS AND ANSWERS When an array is passed to a function, it is actually ________ the array that is passed. - Answer-the starting memory address of True/False: When you pass an array as an argument to a function, the function can modify the contents of the array, affecting it even after the function is complete. - Answer-true A two-dimensional array can be viewed as - Answer-a table with rows and columns. True/False: When you create a vector it is unnecessary to specify how many elements it will hold because it will expand in size as you add new values to it. - Answer-true True/False: After carrying out the following two statements, sales will have been created as a one-dimensional array that can hold 20 double ef salesArray double[20];salesArray sales; - Answer-true True/False: The amount of memory used by an array depends solely on the number of elements the array can hold. - Answer-false You can assign the contents of one array to another by using - Answer-none of the above If the scores array is defined like this:int scores[ ]= {4, 7, 4, 8, 9};what will the following statement display?cout scores[4]; - Answer-9 Subscript numbering in C++ - Answer-automatically begins with zero. True/False: The following statement initializes all five elements of the number array to number[5] = {1}; - Answer-false Unlike regular variables, arrays can hold multiple - Answer-values To access an array element, use the array name and the element's - Answer-subscript True/False: C++ allows a vector to be created with no elements in it. - Answer-true If the array defined as int myArray[20][10] is being passed to a function named displayArray, along with information on the number of rows and number of columns, which of the following function calls is correct? - Answer-displayArray(myArray, 20, 10); True/False: The following array definition is legal because C++ allows arrays to be implicitly grades[ ]; - Answer-False A(n) ________ algorithm arranges data into some order. - Answer-sorting When sorting an array of objects, if the values in the data member being sorted on are out of order for two objects, it is necessary to - Answer-swap the entire two objects. Selection sort requires ________ passes to put n data items in order. - Answer-n-1 To locate a value in an ordered array of 100 items, binary search must examine at most ________ values. - Answer-7 A(n) ________ search is more efficient than a(n) ________ search. - Answer-binary, linear To determine that a item is not in an unordered array of 100 items, linear search must examine an average of ________ values. - Answer-100 True/False: A binary search requires that the elements be in order. - Answer-true The ________ sort usually performs more exchanges than the ________ sort. - Answer-bubble, selection If a selection sort is used to arrange the numbers 8 6 4 9 3 7 in ascending order, what order will the data be in after the first pass of the sort is completed? - Answer-3 6 4 9 8 7 A search can be performed on an array of - Answer-strings. integers. objects. all of the above. True/False: Using a linear search, you are more likely to find an item than if you use a binary search. - Answer-false If the item being searched for is not in the array, binary search stops looking for it and reports that it is not there when - Answer-array index first array index last.

Content preview

ECE 206 EXAM QUESTIONS AND
ANSWERS
When an array is passed to a function, it is actually ________ the array that is passed. -
Answer-the starting memory address of

True/False: When you pass an array as an argument to a function, the function can
modify the contents of the array, affecting it even after the function is complete. -
Answer-true

A two-dimensional array can be viewed as - Answer-a table with rows and columns.

True/False: When you create a vector it is unnecessary to specify how many elements it
will hold because it will expand in size as you add new values to it. - Answer-true

True/False: After carrying out the following two statements, sales will have been created
as a one-dimensional array that can hold 20 double values.typedef salesArray
double[20];salesArray sales; - Answer-true

True/False: The amount of memory used by an array depends solely on the number of
elements the array can hold. - Answer-false

You can assign the contents of one array to another by using - Answer-none of the
above

If the scores array is defined like this:int scores[ ]= {4, 7, 4, 8, 9};what will the following
statement display?cout << scores[4]; - Answer-9

Subscript numbering in C++ - Answer-automatically begins with zero.

True/False: The following statement initializes all five elements of the number array to
1.int number[5] = {1}; - Answer-false

Unlike regular variables, arrays can hold multiple - Answer-values

To access an array element, use the array name and the element's - Answer-subscript

True/False: C++ allows a vector to be created with no elements in it. - Answer-true

If the array defined as int myArray[20][10] is being passed to a function named
displayArray, along with information on the number of rows and number of columns,
which of the following function calls is correct? - Answer-displayArray(myArray, 20, 10);

, True/False: The following array definition is legal because C++ allows arrays to be
implicitly sized.int grades[ ]; - Answer-False

A(n) ________ algorithm arranges data into some order. - Answer-sorting

When sorting an array of objects, if the values in the data member being sorted on are
out of order for two objects, it is necessary to - Answer-swap the entire two objects.

Selection sort requires ________ passes to put n data items in order. - Answer-n-1

To locate a value in an ordered array of 100 items, binary search must examine at most
________ values. - Answer-7

A(n) ________ search is more efficient than a(n) ________ search. - Answer-binary,
linear

To determine that a item is not in an unordered array of 100 items, linear search must
examine an average of ________ values. - Answer-100

True/False: A binary search requires that the elements be in order. - Answer-true

The ________ sort usually performs more exchanges than the ________ sort. -
Answer-bubble, selection

If a selection sort is used to arrange the numbers 8 6 4 9 3 7 in ascending order, what
order will the data be in after the first pass of the sort is completed? - Answer-3 6 4 9 8
7

A search can be performed on an array of - Answer-strings.
integers.
objects.
all of the above.

True/False: Using a linear search, you are more likely to find an item than if you use a
binary search. - Answer-false

If the item being searched for is not in the array, binary search stops looking for it and
reports that it is not there when - Answer-array index first > array index last.

A ________ search uses a loop to sequentially step through an array. - Answer-linear

When an array is sorted from highest to lowest, it is said to be in ________ order. -
Answer-descending

Document information

Uploaded on
January 10, 2025
Number of pages
7
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$11.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.
Scholarsstudyguide
3.9
(168)
Sold
830
Followers
475
Items
16244
Last sold
3 days 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