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

Data Structures Practice Exam Questions And Answers Already Passed | Updated

Rating
-
Sold
-
Pages
11
Grade
A+
Uploaded on
30-07-2025
Written in
2024/2025

Data Structures Practice Exam Questions And Answers Already Passed | Updated

Institution
Data Structures
Course
Data Structures

Content preview

Data Structures Practice Exam
Questions And Answers Already
Passed | Updated
A C++ class can have more than one constructor CORRECT ANSWERS true

In a preorder traversal of a binary tree, for each node, first the node is visited, then the
left tree subtree is visited, then the right subtree is visited CORRECT ANSWERS true

The general case in a recursive function is the case for which the solution is obtained
directly CORRECT ANSWERS false

The elements at the top of the stack have been in the stack the longest CORRECT
ANSWERS false

A linked list in which the last node points to the first node is called a circular linked list
CORRECT ANSWERS true

Every call to a recursive function requires the system to allocate memory for the local
variables and formal parameters CORRECT ANSWERS true

A doubly linked list is a linked list in which every node has a next pointer and a previous
pointer CORRECT ANSWERS true

In the analysis of algorithms, the key comparisons refer to comparing the key of the
search item with the position of an item in the list CORRECT ANSWERS false

You have analyzed a function and determined its runtime is characterized by E^n,
subscript i=1, i

what is the Big Oh for the analyzed code? CORRECT ANSWERS O(n^2)

What is the Big Oh best associated with the following code?

void donald(int n, int x, int y)
{
for (int i = 0; i < n; ++i)
{
if (x < y)
{
for (int j = 0; j < n + n; ++j)
cout << "j= " << j << endl;
} else

, cout << "i= " << i << endl;
}
} CORRECT ANSWERS O(n^2)

A data structure in which the elements are added and removed from one end only is
known as a__________ CORRECT ANSWERS stack

The sequential search is also called a _______________ search CORRECT
ANSWERS linear

Sequential and binary search algorithms are called _________ search algorithms
CORRECT ANSWERS comparison-based

A hash table has which two major components? CORRECT ANSWERS "bucket" array
and hash function

In quicksort, all the sorting work is done in _____________ the list CORRECT
ANSWERS partitioning

In heapsort, after we convert the array into a heap, the ______________ phase begins
CORRECT ANSWERS sorting

Problem: Inheritance

Given there exists a C++ class named Person (ie class Person {...}; is declared in file:
Person.h) Write the code to declare a class named Student that is derived from class
Person. Include the appropriate header file. Use the public specifier. You do NOT need
to have a "using namespace" line. CORRECT ANSWERS #include "Person.h"
class Student: public Person
{
}

Problem: Templates

Write a templated function named LessThanOrEqual. Which will take two parameters: a
and b (of the templated type) and return true if a <= b, else return false CORRECT
ANSWERS template <typename T>
T LessThanOrEqual (T a, T b)
{ return (a <= b ? a : b); }

Problem: Runtime for Data Structures

Data Structure: Ordered Array or Vector

Insert: ____________ CORRECT ANSWERS O(n)

Written for

Institution
Data Structures
Course
Data Structures

Document information

Uploaded on
July 30, 2025
Number of pages
11
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$15.49
Get access to the full document:

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

Get to know the seller

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.
ElevatedExcellence Exam
Follow You need to be logged in order to follow users or courses
Sold
924
Member since
3 year
Number of followers
504
Documents
18336
Last sold
14 hours ago
GETSOCIO EDUCATION

We have launched our assignments at a very reasonable price so that every student can enjoy its features. Our new method is gathering quite a positive feedback from the students, and many of our alumnus are fully satisfied with it. We would be glad if you purchase from us. THANK YOU!!

3.8

175 reviews

5
79
4
36
3
29
2
10
1
21

Recently viewed by you

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