• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 3 fuera de 16 páginas
Examen

Data Structures And Algorithms Exam Questions And Answers (Graded A)

Document preview thumbnail
Vista previa 3 fuera de 16 páginas

DATA STRUCTURES AND ALGORITHMS EXAM QUESTIONS AND ANSWERS (GRADED A)

Vista previa del contenido

DATA STRUCTURES AND
ALGORITHMS EXAM QUESTIONS AND
ANSWERS



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 a hash function? - Correct Answers -It hashes (converts) a number in a large
range into a number in a smaller range. The smaller range corresponds to the index
numbers in an array.

What is a hash table? - Correct Answers -An array into which data is inserted using a
hash function.

How does a hash function work? - Correct Answers -1. We convert a word into a huge
number by multiplying each character in the word by an appropriate power of 27 and set
it equal to hudgeNumber

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;

Información del documento

Subido en
28 de julio de 2025
Número de páginas
16
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$14.99

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
millyphilip
3.7
(562)
Vendido
3010
Seguidores
1964
Artículos
47650
Última venta
3 horas hace



Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes