100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
WGU C949 Data Structures and Algorithms Study test in depth Examination and 100% correctly verified Solutions Latest version 2024/2025 $11.49   Add to cart

Exam (elaborations)

WGU C949 Data Structures and Algorithms Study test in depth Examination and 100% correctly verified Solutions Latest version 2024/2025

 0 view  0 purchase
  • Course
  • WGU C949 Data Structure and Algorithm
  • Institution
  • WGU C949 Data Structure And Algorithm

WGU C949 Data Structures and Algorithms Study test in depth Examination and 100% correctly verified Solutions Latest version 2024/2025 Which of the following statements are true about adts and classes? A.) A given ADT can be implemented by only single class B.) A given ADT can be implemente...

[Show more]

Preview 4 out of 46  pages

  • November 12, 2024
  • 46
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • WGU C949 Data Structure and Algorithm
  • WGU C949 Data Structure and Algorithm
avatar-seller
KieranKent55
WGU C949 Data Structures and Algorithms
Study test in depth Examination and 100%
correctly verified Solutions Latest version
2024/2025

Which of the following statements are true about adts and
classes?


A.) A given ADT can be implemented by only single class
B.) A given ADT can be implemented by more than one class
C.) A given class can implement only a single ADT
D.) A given class can implement more than one ADT - correct
answer b.) A given ADT can be implemented by more than one
class
D.) A given class can implement more than one ADT


How will we represent adts in this course?


A.) As regular Java classes
B.) As abstract Java classes
C.) As Java interfaces - correct answer c.) As Java interfaces


If I implement a deque with the logical front being fixed at index
0, which operations will require shifting?


A.) Addtofront();
B.) Addtoback();

,C.) Removefront();
D.) Removeback(); - correct answer a.) Addtofront();
C.) Removefront();


What is the best description of the relationship between Abstract
Data Types (adts) and Java classes?


A.) One ADT can be implemented by one class and one class can
implement one ADT
B.) One ADT can be implemented by many classes and one class
can implement one ADT
C.) One ADT can be implemented by one class and one class can
implement many adts
D.) One ADT can be implemented by many classes and one class
can implement many adts - correct answer d.) One ADT can
be implemented by many classes and one class can implement
many adts


Consider the simplequeue<T> implementation of
queueinterface<T> as discussed in lecture. Assuming that we
have a back index to represent the end of the queue, which
operations will cause the back index to be changed / modified in
the simplequeue<T>? Indicate all methods where back will be
modified.


A.) Enqueue();
B.) Dequeue()
C.) Getfront();
D.) Clear(); - correct answer a.) Enqueue();

,B.) Dequeue();
D.) Clear();


Based on the baginterface discussed in lecture, if we add() an
object that already exists in the bag, what will we do?


A.) Do nothing -- the item will not be added
B.) Replace the old copy of the item with the new one
C.) Add the new object as a separate value in the bag
D.) Throw an exception - correct answer c.) Add the new
object as a separate value in the bag


Based on the baginterface<T>, in the add() method where in the
bag should the new item be placed?


A.) At the back of the array
B.) At the front of the array
C.) The baginterface does not specify where an item should be
added. - correct answer c.) The baginterface does not specify
where an item should be added.


What are some limitations of the arraybag<T> (fixed array)
implementation of baginterface<T>?


A.) May waste memory with a very large array
B.) May run out of room in the bag

, C.) Overhead in copying data when resizing array - correct
answer a.) May waste memory with a very large array
B.) May run out of room in the bag


In the remove(T anelement) method in the arraybag<T>, how do
we fill in the gap created by the removed element?


A.) We shift the items over to fill in the gap
B.) We copy the front item of the array into the location of the
deleted item
C.) We copy the back item of the array into the location of the
deleted item
D.) We don't fill in the gap -- we leave the gap there. - correct
answer c.) We copy the back item of the array into the location
of the deleted item


Consider an arraybag<T> implemented using the following
variables:


T [] bag;
Int numberofitems;


A.) Bag.length is the logical size of the bag and numberofitems is
the physical size of the bag
B.) Bag.length is the physical size of the bag and numberofitems
is the logical size of the bag
C.) Bag.length and numberofitems must always have the same
value

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

Will I be stuck with a subscription?

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

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

77858 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
$11.49
  • (0)
  Add to cart