Docsity

WGU C949: DATA STRUCTURES AND ALGORITHMS I COMPLETE PRACTICE EXAM, Exams of Nursing

Toggle sidebar
bg1
1 | P a g e
WGU C949: DATA STRUCTURES AND
ALGORITHMS I COMPLETE
PRACTICE EXAM – 300 EXAM-STYLE
QUESTIONS WITH VERIFIED
ANSWERS & DETAILED RATIONALES
### OFFICIAL EXAM BLUEPRINT (Objective Assessment)
| Section | Competency Area | Official Weighting | Questions
in This Exam |
|---------|----------------|-------------------|------------------------|
| 1 | Data Types (Primitive Types, Abstract Data Types,
Classes, Type Systems) | 36% | 108 (Q1–108) |
| 2 | Data Structures (Arrays, Linked Lists, Stacks, Queues,
Trees, Hash Tables, Heaps, Graphs) | 30% | 90 (Q109–198) |
| 3 | Algorithms (Searching, Sorting, Recursion, Iteration,
Algorithm Design) | 34% | 102 (Q199–300) |
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download WGU C949: DATA STRUCTURES AND ALGORITHMS I COMPLETE PRACTICE EXAM and more Exams Nursing in PDF only on Docsity!

WGU C949: DATA STRUCTURES AND

ALGORITHMS I COMPLETE

PRACTICE EXAM – 300 EXAM-STYLE

QUESTIONS WITH VERIFIED

ANSWERS & DETAILED RATIONALES

OFFICIAL EXAM BLUEPRINT (Objective Assessment)

| Section | Competency Area | Official Weighting | Questions in This Exam | |---------|----------------|-------------------|------------------------| | 1 | Data Types (Primitive Types, Abstract Data Types, Classes, Type Systems) | 36% | 108 (Q1–108) | | 2 | Data Structures (Arrays, Linked Lists, Stacks, Queues, Trees, Hash Tables, Heaps, Graphs) | 30% | 90 (Q109–198) | | 3 | Algorithms (Searching, Sorting, Recursion, Iteration, Algorithm Design) | 34% | 102 (Q199–300) |

Exam details: The official WGU C949 Objective Assessment contains 70 multiple-choice questions. This 300-question practice exam provides comprehensive coverage of all tested competencies.

SECTION 1: DATA TYPES

Primitive Types, Abstract Data Types, Classes, and

Type Systems

(Questions 1–108)

  1. Which of the following is a primitive data type? A. Stack — a LIFO collection with push and pop operations B. Integer — a built-in numeric type such as 42 C. Linked List — a collection of nodes connected by references D. Queue — a FIFO collection with enqueue and dequeue operations

Answer: C Rationale: An ADT is a logical description of WHAT a container does — its allowed values and operations — while deliberately hiding HOW those operations work. The implementation (array vs. linked nodes) is left to the data structure. ADTs also make no complexity guarantees; performance depends entirely on the chosen implementation.

  1. A developer calls list_add(item) and list_remove(item) on a collection. The documentation never mentions whether the list uses an array or linked nodes internally. Which fundamental concept does this illustrate? A. Abstraction — the ADT interface exposes operations while hiding the underlying implementation B. Recursion — the list calls itself to locate elements C. Polymorphism — the list takes many forms at compile time D. Instantiation — the list is copied into an object at runtime Answer: A

Rationale: Hiding the storage mechanism behind a stable operation set is precisely the abstraction an ADT provides.

  1. Which of the following best describes a data structure? A. A logical description of what operations a container supports B. A concrete implementation of an ADT that specifies how data is stored and organized in memory C. A programming language feature that enforces type safety D. A mathematical model for analyzing algorithm efficiency Answer: B Rationale: A data structure is the concrete implementation of an ADT, specifying the memory layout and algorithms used to store and retrieve data.
  2. What is encapsulation in object-oriented programming? A. The process of creating multiple instances of a class

Rationale: An array is a composite data type because it is constructed from primitive types (e.g., integers) and organizes them into a structured collection.

  1. What does a class define in object-oriented programming? A. A specific instance of an object B. A blueprint or template for creating objects, specifying attributes and methods C. A primitive data type D. A mathematical function Answer: B Rationale: A class is a blueprint that defines the attributes (data) and methods (behavior) that objects of that class will have.
  2. What is an object in object-oriented programming? A. A blueprint for creating instances

B. An instance of a class that contains specific data and can perform the methods defined by the class C. A primitive data type D. A type of algorithm Answer: B Rationale: An object is a specific instance of a class, with its own state (attribute values) and access to the class's methods.

  1. Which of the following is NOT a characteristic of a primitive data type? A. It stores a single atomic value B. It is provided directly by the programming language C. It can contain multiple different data types D. It has a fixed size in memory Answer: C

B. String C. List D. Integer Answer: C Rationale: Lists are mutable in Python, meaning their contents can be changed after creation. Tuples, strings, and integers are immutable.

  1. In Python, which of the following is an immutable data type? A. List B. Dictionary C. Set D. Tuple Answer: D

Rationale: Tuples are immutable in Python, meaning their contents cannot be changed after creation. Lists, dictionaries, and sets are mutable.

  1. What is the time complexity of accessing an element at index i in an array? A. O(1) B. O(log n) C. O(n) D. O(n²) Answer: A Rationale: Arrays provide direct access to any element using its index through pointer arithmetic in constant time, O(1). This is known as random access.
  2. What is the primary advantage of using an array over a linked list? A. Dynamic resizing

Rationale: Static arrays have a fixed size determined at creation. Inserting or deleting elements in the middle requires shifting subsequent elements, which is O(n).

  1. What is a dynamic array? A. An array with a fixed size determined at compile time B. An array that can automatically resize itself when elements are added or removed C. An array that can store multiple data types D. An array that uses linked nodes for storage Answer: B Rationale: A dynamic array automatically resizes itself (typically by doubling its capacity) when it runs out of space, providing amortized O(1) append operations.
  2. What is the amortized time complexity of appending an element to a dynamic array? A. O(1)

B. O(log n) C. O(n) D. O(n²) Answer: A Rationale: Although a resize operation takes O(n) time, it occurs infrequently (geometrically), so the amortized cost per append is O(1).

  1. Which of the following best describes a record (or struct)? A. A collection of elements of the same type B. A collection of named fields, potentially of different types C. A LIFO data structure D. A FIFO data structure Answer: B

B. An unordered collection of unique elements C. A collection that allows duplicate elements D. A LIFO data structure Answer: B Rationale: A set is an unordered collection that does not allow duplicate elements.

  1. What is the average time complexity of checking membership in a hash set? A. O(1) B. O(log n) C. O(n) D. O(n²) Answer: A Rationale: Hash sets provide average O(1) membership testing by using a hash function to map elements to buckets.
  1. What is a bag (or multiset) in data structures? A. An ordered collection of unique elements B. An unordered collection that allows duplicate elements C. A LIFO data structure D. A FIFO data structure Answer: B Rationale: A bag (or multiset) is an unordered collection that allows duplicate elements, unlike a set.
  2. Which of the following best describes an abstract data type (ADT)? A. A concrete implementation of a data structure B. A mathematical model that specifies the behavior of a data type from the user's perspective C. A primitive data type D. A type of algorithm Answer: B

B. Float C. Stack D. Character Answer: C Rationale: A stack is an ADT that defines operations (push, pop, peek) and their behavior, independent of implementation.

  1. What is inheritance in object-oriented programming? A. The ability of a class to inherit attributes and methods from a parent class B. The bundling of data and methods C. The ability of an object to take many forms D. The process of creating objects Answer: A

Rationale: Inheritance allows a class (subclass) to inherit attributes and methods from another class (superclass), promoting code reuse.

  1. What is polymorphism in object-oriented programming? A. The ability of an object to take many forms B. The bundling of data and methods C. The ability to inherit from a parent class D. The process of creating objects Answer: A Rationale: Polymorphism allows objects of different classes to be treated as objects of a common superclass, with method behavior determined at runtime.
  2. What is method overriding? A. Defining a method in a subclass with the same signature as a method in the superclass