Font size
S
M
L
XL
WorksheetsData Structures & Algorithms — Prelim Exam
Total questions: 40
Worksheet time: 1hrs 20mins
Name
Class
Date
1.
Arrays in JavaScript are always fixed in size.
a)
True
b)
False
2.
Elements in an array are stored at contiguous memory locations.
a)
True
b)
False
3.
JavaScript arrays are zero-indexed, meaning the first element starts at index 1.
a)
True
b)
False
4.
.push() adds elements to the end of an array.
a)
True
b)
False
5.
.pop() removes the first element of an array.
a)
True
b)
False
6.
.unshift() adds one or more elements at the beginning of an array.
a)
True
b)
False
7.
.shift() removes the last element of an array.
a)
True
b)
False
8.
Associative arrays in JavaScript are typically implemented using Objects.
a)
True
b)
False
9.
Multidimensional arrays are arrays that contain other arrays.
a)
True
b)
False
10.
The operation arr.pop() returns the removed element.
a)
True
b)
False
11.
Inserting an element at the beginning of a JavaScript array is an O(1) operation.
a)
True
b)
False
12.
Arrays maintain the order of elements, making them predictable for sequential access.
a)
True
b)
False
13.
Linear search on an unsorted array has a time complexity of O(n).
a)
True
b)
False
14.
Hash tables and arrays both use key-value pairs for access.
a)
True
b)
False
15.
A stack follows the FIFO (First-In, First-Out) principle.
a)
True
b)
False
16.
Queues are often implemented using arrays or linked lists.
a)
True
b)
False
17.
.includes() returns true if an element is found in an array.
a)
True
b)
False
18.
.map() modifies the original array permanently.
a)
True
b)
False
19.
Multidimensional arrays are useful for tabular data representation.
a)
True
b)
False
20.
.reduce() can be used to sum all the numbers in an array.
a)
True
b)
False
21.
A data structure where elements are stored in sequential memory locations and accessed by index.
4 lines
22.
The built-in JavaScript method that adds elements to the end of an array.
4 lines
23.
The built-in JavaScript method that removes the first element of an array.
4 lines
24.
A collection of key-value pairs, commonly implemented with objects in JavaScript.
4 lines
25.
The type of array that contains other arrays, often used to represent grids or tables.
4 lines
26.
The time complexity of accessing an element in an array using its index.
4 lines
27.
The array method used to find the index of a given element.
4 lines
28.
The array method that creates a new array with all elements passing a condition.
4 lines
29.
The operation used to traverse arrays element by element.
4 lines
30.
A Last-In, First-Out (LIFO) abstract data type.
4 lines
31.
A First-In, First-Out (FIFO) abstract data type.
4 lines
32.
The built-in method that checks whether every element in an array satisfies a condition.
4 lines
33.
A data structure that uses a hash function to store and retrieve key-value pairs.
4 lines
34.
The array method that executes a function for each element without returning a new array.
4 lines
35.
The array method that sorts elements in place.
4 lines
36.
The JavaScript method that adds one or more elements at the beginning of an array.
4 lines
37.
The output of console.log(["A","B","C"].pop());
4 lines
38.
The output of console.log(["X","Y","Z"].shift());
4 lines
39.
The type of loop best used when you want to iterate directly over element values.
4 lines
40.
The general term for structures like Arrays, Linked Lists, Stacks, and Queues.
4 lines
Reset
