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