Data Structures and Algorithms Questions and Answers
Rated A
What is a data structure? - ANSWER -An An object is often referred to as: -
arrangement of data inside a computers memory ANSWER -An instance of a class.
or a disk.
object.method(); is and example of -
Name 5 data types - ANSWER -BLASH: ANSWER -Invoking a method for a specific
binary trees, linked lists, arrays, stacks, hash object.
tables
Execution of the program starts where? -
What do algorithms do? - ANSWER - ANSWER -main()
Manipulate the data in data structures in various
ways such as sorting.
To create an object in Java you must do two
things: - ANSWER -1. Use the keyword
What is real-world storage data? - "new"
ANSWER -Data structure storage that 2. Store a reference to the object in a variable
describes physical entities external to the that is the same type as the class.
computer. Accessed by a programs user. So:
Object = new ClassReference();
What are programmer's tools? - ANSWER -
Data structure storage that is accessed by the How do other parts of your program interact with
program itself. Ex - stacks and queues. objects? - ANSWER -By interacting with an
objects methods
What is real-world modeling? - ANSWER -
Data structures that directly model real-world What is a constructor? - ANSWER -A
situations...think graphs. special method that is called automatically
whenever a new object is created. It prepares the
object for use.
What is an object? - ANSWER -A software
bundle of variables and related methods.
How is the constructor named? -
ANSWER -It has the same name as the
What is a class? - ANSWER -A blueprint class it resides in.
that defines an objects variables and methods.
A field of method that is private can only be
The keyword "new" is used to do what? - accessed by - ANSWER -Methods that are
ANSWER -Create a new object in Java. apart of the same class.
, Data Structures and Algorithms Questions and Answers
Rated A
Any outside entity that wants to access data in a
class can do so by: - ANSWER -Using a
method of that class. long [] arr is; an example of: - ANSWER -
Referencing an array.
What must be added to all input methods for
them to work? - ANSWER -throws arr = new long [100];is an example of: -
IOException ANSWER -Creating an array.
What does the charAt() method do? - int nElems = 0; is an example of: -
ANSWER -Returns a character at the ANSWER -The number of items in the array
specific position in the string object. .
What does the parse.Int() method do? - int x; is an example of: - ANSWER -A loop
ANSWER -Converts the string type into an creator.
integer.
What does the searchKey variable do? -
What is an array? - ANSWER -A container ANSWER -IT holds the value we are
object that holds multiple values of the same looking for.
type.
What are the three steps to delete an item in an
What are the two types of data in java? - array? - ANSWER -1.Search for the item
ANSWER -Primitive types (int, char, 2. Find the item
boolean,long, double etc) and objects. 3. Move the items with a higher index value down
to fill the "hole"
Why must you use the key word "new" when
creating an array? - ANSWER -Arrays in First two steps of object-oriented approach? -
java are treated as objects. ANSWER -1. Separate the data structure
storage from the rest of the program(now called
the user).
What does the [] operator tell the compiler? - 2. Improve the communication between the
ANSWER -That we are naming an array storage structure and the user.
object.
Breaking up the program into classes does what?
What are the steps to creating an array? - - ANSWER -Makes it easier to design,
ANSWER -MRCNL: Main(), Reference, understand, modify and maintain the program.
Create an Array, Number of Items, Loop.
Rated A
What is a data structure? - ANSWER -An An object is often referred to as: -
arrangement of data inside a computers memory ANSWER -An instance of a class.
or a disk.
object.method(); is and example of -
Name 5 data types - ANSWER -BLASH: ANSWER -Invoking a method for a specific
binary trees, linked lists, arrays, stacks, hash object.
tables
Execution of the program starts where? -
What do algorithms do? - ANSWER - ANSWER -main()
Manipulate the data in data structures in various
ways such as sorting.
To create an object in Java you must do two
things: - ANSWER -1. Use the keyword
What is real-world storage data? - "new"
ANSWER -Data structure storage that 2. Store a reference to the object in a variable
describes physical entities external to the that is the same type as the class.
computer. Accessed by a programs user. So:
Object = new ClassReference();
What are programmer's tools? - ANSWER -
Data structure storage that is accessed by the How do other parts of your program interact with
program itself. Ex - stacks and queues. objects? - ANSWER -By interacting with an
objects methods
What is real-world modeling? - ANSWER -
Data structures that directly model real-world What is a constructor? - ANSWER -A
situations...think graphs. special method that is called automatically
whenever a new object is created. It prepares the
object for use.
What is an object? - ANSWER -A software
bundle of variables and related methods.
How is the constructor named? -
ANSWER -It has the same name as the
What is a class? - ANSWER -A blueprint class it resides in.
that defines an objects variables and methods.
A field of method that is private can only be
The keyword "new" is used to do what? - accessed by - ANSWER -Methods that are
ANSWER -Create a new object in Java. apart of the same class.
, Data Structures and Algorithms Questions and Answers
Rated A
Any outside entity that wants to access data in a
class can do so by: - ANSWER -Using a
method of that class. long [] arr is; an example of: - ANSWER -
Referencing an array.
What must be added to all input methods for
them to work? - ANSWER -throws arr = new long [100];is an example of: -
IOException ANSWER -Creating an array.
What does the charAt() method do? - int nElems = 0; is an example of: -
ANSWER -Returns a character at the ANSWER -The number of items in the array
specific position in the string object. .
What does the parse.Int() method do? - int x; is an example of: - ANSWER -A loop
ANSWER -Converts the string type into an creator.
integer.
What does the searchKey variable do? -
What is an array? - ANSWER -A container ANSWER -IT holds the value we are
object that holds multiple values of the same looking for.
type.
What are the three steps to delete an item in an
What are the two types of data in java? - array? - ANSWER -1.Search for the item
ANSWER -Primitive types (int, char, 2. Find the item
boolean,long, double etc) and objects. 3. Move the items with a higher index value down
to fill the "hole"
Why must you use the key word "new" when
creating an array? - ANSWER -Arrays in First two steps of object-oriented approach? -
java are treated as objects. ANSWER -1. Separate the data structure
storage from the rest of the program(now called
the user).
What does the [] operator tell the compiler? - 2. Improve the communication between the
ANSWER -That we are naming an array storage structure and the user.
object.
Breaking up the program into classes does what?
What are the steps to creating an array? - - ANSWER -Makes it easier to design,
ANSWER -MRCNL: Main(), Reference, understand, modify and maintain the program.
Create an Array, Number of Items, Loop.