WGU C949 Data Types STUDY GUIDE| Data Structures &
Algorithms 1- Qs & As
Linked List CORRECT ANS-A linear data structure, much like an array, that consists of
nodes, where each node contains data as well as a link to the next node, but that does not
use contiguous memory.
Head and tail node
The LinkedList class implements the list data structure and contains two data members, head
and tail, which are assigned to nodes once the list is populated. Initially the list has no nodes,
so both data members are initially assigned with None.
If the node has no next node, the next data member is assigned with None, the Python term
signifying the absence of a value.
Deque CORRECT ANS-Short for double-ended queue- an ADT in which items can be
inserted and removed at both the front and back.
Underlying data structures: Linked list
Bag CORRECT ANS-An ADT for storing items in which the order does not matter and
duplicate items are allowed.
Underlying data structures: Linked list, Array
Set CORRECT ANS-An ADT for a collection of distinct items. (no dups!)
Underlying data structures: Binary search tree, Hash table
Priority queue CORRECT ANS-A queue where each item has a priority, and items with
higher priority are closer to the front of the queue than items with lower priority. Dups ok
, WGU C949 Data Types STUDY GUIDE| Data Structures &
Algorithms 1- Qs & As
Underlying data structures: Heap
*In addition to push and pop, a priority queue usually supports peeking and length querying.
A peek operation returns the highest priority item, without removing the item from the front
of the queue.
Pop returns front or head item which is top priority item
Dictionary (Map) CORRECT ANS-A dictionary is an ADT that associates (or maps) keys with
values.
Underlying data structures: Binary search tree, Hash table
Dictionary key characteristic CORRECT ANS-They are unique and immutable.
dict.items() CORRECT ANS-returns a view object that yields (key, value) tuples.
dict.keys() CORRECT ANS-returns a view object that yields dictionary keys.
dict.values() CORRECT ANS-returns a view object that yields dictionary values.
Dict for loop CORRECT ANS-A for loop over a dict retrieves each key in the dict.
ie.. for key in dictionary:
dict operations CORRECT ANS-my_dict[key]
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 TheeGrades. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $11.99. You're not tied to anything after your purchase.