WGU C949 Competency study guide Exam test questions with approved Answers 2024/2025
0 view 0 purchase
Course
WGU C949 Data Structure and Algorithm
Institution
WGU C949 Data Structure And Algorithm
WGU C949 Competency study guide Exam test questions with approved Answers 2024/2025
Array in java - correct answer generic class that supports different data types. Declared as follows, where t is the data type.
Tuple - correct answer sequence type: an immutable container with ordered element...
Stack operations - correct answer example starting with
stack: 99, 77 (top is 99).
Push(stack, x)
Inserts x on top of stack
,Push(stack, 44). Stack: 44, 99, 77
Pop(stack)
Returns and removes item at top of stack
Pop(stack) returns: 99. Stack: 77
Peek(stack)
Returns but does not remove item at top of stack
Peek(stack) returns 99. Stack still: 99, 77
Isempty(stack)
Returns true if stack has no items
Isempty(stack) returns false.
Getlength(stack)
Returns the number of items in the stack
Getlength(stack) returns 2.
Implementing a stack in python (linear data structure) - correct
answer can be implemented in python using a class with a
single linkedlist data member.
The class has two methods, push() and pop().
Push() adds a node to the top of the stack's list by calling
linkedlist's prepend() method.
, *new elements are place on the top of the stack, not at the
bottom of the stack.
Pop() removes the head of the stack's list by calling the
linkedlist's remove_after() method and then returns the removed
node.
Implementing a queue in python (linear data structure) -
correct answer can also be implemented in python using a
class with a single linkedlist data member and class methods
push() and pop().
Push() adds a node to the end of the queue's list by calling
linkedlist's append() method.
*new elements are added to the end of a queue.
The pop() method removed the queue's head node and is
identical to stack's pop() method.
Queue - correct answer an adt in which items are inserted at
the end of the queue and removed from the front of the queue.
*first-in first-out adt.
Underlying data structures: linked list, array, vector
The queue class' push() method uses the linkedlist append()
method to insert elements in a queue.
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 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.