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 and Algorithms Exam Questions With Correct Answers Already Passed!!!

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

Data Structures and Algorithms Exam Questions With Correct Answers Already Passed!!!

Institution
Data Structures
Course
Data Structures

Content preview

Data Structures and Algorithms Exam
Questions With Correct Answers
Already Passed!!!
What is a data structure? CORRECT ANSWERS An arrangement of data inside a
computers memory or a disk.

Name 5 data types CORRECT ANSWERS BLASH: binary trees, linked lists, arrays,
stacks, hash tables

What do algorithms do? CORRECT ANSWERS Manipulate the data in data structures
in various ways such as sorting.

What is real-world storage data? CORRECT ANSWERS Data structure storage that
describes physical entities external to the computer. Accessed by a programs user.

What are programmer's tools? CORRECT ANSWERS Data structure storage that is
accessed by the program itself. Ex - stacks and queues.

What is real-world modeling? CORRECT ANSWERS Data structures that directly model
real-world situations...think graphs.

What is an object? CORRECT ANSWERS A software bundle of variables and related
methods.

What is a class? CORRECT ANSWERS A blueprint that defines an objects variables
and methods.

The keyword "new" is used to do what? CORRECT ANSWERS Create a new object in
Java.

An object is often referred to as: CORRECT ANSWERS An instance of a class.

object.method(); is and example of CORRECT ANSWERS Invoking a method for a
specific object.

Execution of the program starts where? CORRECT ANSWERS main()

To create an object in Java you must do two things: CORRECT ANSWERS 1. Use the
keyword "new"
2. Store a reference to the object in a variable that is the same type as the class.
So:
Object = new ClassReference();

,How do other parts of your program interact with objects? CORRECT ANSWERS By
interacting with an objects methods

What is a constructor? CORRECT ANSWERS A special method that is called
automatically whenever a new object is created. It prepares the object for use.

How is the constructor named? CORRECT ANSWERS It has the same name as the
class it resides in.

A field of method that is private can only be accessed by CORRECT ANSWERS
Methods that are apart of the same class.

Any outside entity that wants to access data in a class can do so by: CORRECT
ANSWERS Using a method of that class.

What must be added to all input methods for them to work? CORRECT ANSWERS
throws IOException

What does the charAt() method do? CORRECT ANSWERS Returns a character at the
specific position in the string object.

What does the parse.Int() method do? CORRECT ANSWERS Converts the string type
into an integer.

What is an array? CORRECT ANSWERS A container object that holds multiple values
of the same type.

What are the two types of data in java? CORRECT ANSWERS Primitive types (int,
char, boolean,long, double etc) and objects.

Why must you use the key word "new" when creating an array? CORRECT ANSWERS
Arrays in java are treated as objects.

What does the [] operator tell the compiler? CORRECT ANSWERS That we are naming
an array object.

What are the steps to creating an array? CORRECT ANSWERS MRCNL: Main(),
Reference, Create an Array, Number of Items, Loop.

long [] arr is; an example of: CORRECT ANSWERS Referencing an array.

arr = new long [100];is an example of: CORRECT ANSWERS Creating an array.

int nElems = 0; is an example of: CORRECT ANSWERS The number of items in the
array .

, int x; is an example of: CORRECT ANSWERS A loop creator.

What does the searchKey variable do? CORRECT ANSWERS IT holds the value we
are looking for.

What are the three steps to delete an item in an array? CORRECT ANSWERS
1.Search for the item
2. Find the item
3. Move the items with a higher index value down to fill the "hole"

First two steps of object-oriented approach? CORRECT ANSWERS 1. Separate the
data structure storage from the rest of the program(now called the user).
2. Improve the communication between the storage structure and the user.

Breaking up the program into classes does what? CORRECT ANSWERS Makes it
easier to design, understand, modify and maintain the program.

What are the steps to setting up an array class with a constructor? CORRECT
ANSWERS RCCSGE: Reference the array, Constructor, Create an Array, Set Value,
Get Value, End Class.

private long[] a; is an example of: CORRECT ANSWERS Referencing an array.

public LowArray(int size) is an example of what? Note that LowArray is also the name of
the class. CORRECT ANSWERS Creating a Constructor.

{a = new long [size]; } is an example of what? CORRECT ANSWERS Creating an array

public void setElement(int index, long value)
{a[index] = value;

is an example of what? CORRECT ANSWERS Set value

public long getElem(int index)
{return a[index];}

is an example of what? CORRECT ANSWERS Get value

What is public static void main(String args[])? CORRECT ANSWERS This is a main()
method with three modifiers

What is meant by public in
public static void main(String args[]) ? CORRECT ANSWERS Public indicates that the
main() method can be called by any object.

Written for

Institution
Data Structures
Course
Data Structures

Document information

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

Subjects

$14.99
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
22 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