Arrays, Arraylists Flashcards

1
Q

a set of well-
defined instructions to solve a
particular problem. It takes a
set of input(s) and produces the
desired output.

A

Algorithm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

a storage that is
used to store and organize data.

A

Data Structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

the elements are arranged in sequence
one after the other. Since elements
are arranged in particular order,
they are easy to implement.

A

Linear Data Structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

are arranged in a
hierarchical manner where one
element will be connected to one or
more elements.

A

Non-Linear Data Structure

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Fixed-size sequential collection of elements of the same kind.

A

Arrays

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

To find out how many elements an array has,

A

length

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

an array of arrays.

A

Multidimensional Arrays

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Most basic type of Multidimensional Array and is also called the matrix

A

2d array

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

the Java Collection Framework. This class
provides static methods to
dynamically create and access
Java arrays.

A

Array Class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

a part of the
Java collection framework and it
is a class of java.util package.
It provides us with dynamic
arrays in Java.

A

ArrayList

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

ArrayList in Java can be seen as a vector in

A

C++

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Array List Advantages

A
  1. Dynamic size
  2. Easy to use
  3. Fast Access
  4. Ordered Collections
  5. Support Null Values
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Array List Disadvantages

A
  1. Slower than arrays
  2. Increased Memory Usage
  3. Not Thread Safe
  4. Performance Degradation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

ArrayLists Methods

A

add();
remove();
size();
get();
clear();
set();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Array Methods

A

toString();
binarySearch();
compare();
sort();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

ArrayList can not be used for primitive types, like int,
char, etc. We need a ________ class for such cases.

A

Wrapper

17
Q

Which package contains the Scanner class

A

java.util packgae

18
Q

Operator used to concatenate two strings in java

A

+

19
Q

Used to test two strings for equality

A

equals()

20
Q

Every IF statement in java does not need to be followed by an ELSE OR ELSE IF statement

A

TRUE

21
Q

Accesses a specific element in an array

A

INDEX

22
Q

Syntax for creating an Array

A

data_type[] name_of_array = new data_type[size of array];