WorksheetsDSA Basics
Total questions: 65
Worksheet time: 1hrs 5mins
Example of linear data structure except
array
tree
queue
stack
Which of the following are examples of Data Structures?
Linear List
Linked List
Stacks
Trees
Pseudocodes
What do you this data structure classification in which the elements are stored/accessed on a non-linear order such as trees and graphs.
trees
linear
non-linear
graphs
Which of these in NOT a linear data structure?
Tree
Stack
Array
Queue
The two major factors of data structure complexity are:
time and location
type and size
time and memory
type and space
If you want the method to return a value, you can use a primitive data type instead of void, and use the (a) keyword inside the method.
(use small letters and space if necessary)
A data structure which is a programming technique you can use in which a method calls itself to solve a problem.
(use small letters and space if necessary)
(a)
(a) is a collection of elements used to store the same type of data.
(use small letters and space if necessary)
int num[ ] = {11, 2, 99, 4, 33, 14, 18};
How would you access the fourth element in num.
(no spacing in writing the answer)
(a)
A recursive method is ________
a method that cannot be called more than once
a method that will never iterate infinitely
a method that invokes itself by name within the method
Index values of an array ranges from ________.
0 to length
1 to length
1 to length
0 to length-1
The program may run out of memory in a ___
non-recursive function call
condition when too many variables are declared
recursive function call
none of the above
Which of the following problems can be solved using recursion?
finding the factorial of a number
finding Nth number of the Fibonacci sequence
finding the length of a string
all of the above
(a) act as variables inside the method.
(plural form, use small letters and space if necessary)
Name the condition at which the recursive method will stop calling itself.
(use small letters and space if necessary)
(a)
float numarr[4];
What is the range of the index?
(use numerical value and write "to" in-between the range, use space if necessary)
(a)
When a parameter is passed to the method, it is called an (a) .
(singular form, use small letters and space if necessary)
int[] arr;
Write the instantiating code with the length of 5.
(use proper symbol, space before and after "=" symbol)
(a)
What is the error in the following code fragment?
float ave[20];
ave[20]=10.44;
a cast is required
a two-dimensional array is required
data not initialized
array out-of-bounds
What would happen if the base case if not defined in the recursive method?
stack underflow
index out of bounds
stack overflow
none of the above
What is the output?
(a)
Methods are used to perform certain actions, and they are also known as (a) . (plural form, use small letters and space if necessary)
Java code to display the size of an array name studname[ ].
System.out.println("The size is " + studentname[ index ]);
System.out.println("The size is " + length.length);
System.out.println("The size is " + studentname);
System.out.println("The size is " + studname.length);
Identify the name of the array based on the code segment below:
for(int j=0; j<studnum.length; j++) {
System.out.print("Enter student number: ");
(a)
}
Insert the missing part in creating and instantiating an array.
int[] arr = { 77, 22, 44}
(a)
An algorithm should be in the right order.
Write T if the statement is TRUE otherwise F.
(a)
A mathematical-model with a collection of operations defined on that model is called _____.
algorithm
data structure
data type
abstract data type
When you write an algorithm you need to include ________, step-by-step instructions.
ambiguous
multiple
clear
precise
It is a property to get the size of an array.
(use small letters and spacing if necessary)
(a)
double[][] arr = {{4.2, 4.3, 4.0}, {4.1, 4.4} };
What is the element in arr[1][0] ?
(a)
Algorithm is a
Step by step procedure
difficult procedure
complex
hard steps
Flowchart are ____________________________ in nature.
Easy
Simple
Complex
Hard
______________________ is a pictorial representation of steps.
Algorithm
Flowchart
Connectors
Flowlines
(a) are used to connect the boxes.
We use different boxes in
steps
flowchart
algorithm
quiz
Flowcharts are from
Left
Right
Bottom
Top to bottom
____________________________ must be organized properly.
Puzzle
Quiz
Flowchart
Algorithm
We use this in the beginning of an Algorithm & Flowchart.
Start box
Stop box
Decision
Flowlines
Which box is used for processing instructions.
Input
Algorithm
Decision
Processing
Which box is used for accepting inputs or giving output?
Start
Stop
Input Output
Condition
