Other Data Structures
Linked Lists
Binary
Javascript
Run This Code
100
A stack is an example of a ____ data structure. A) LIFO B) FIFO
A) LIFO
100
What is the worst case time complexity for looking up an item in a linked list?
O(n)
100
Calculate the following binary logic: 1010 | 101 (bitwise OR)
1111
100
What is the typeof null?
"object"
100
// What is the value of str after the following code executes? let str = 'the Thing'; str[0] = str[0].toUpperCase(); A) 'The Thing' B) 'THE THING' C) 'The thing' D) 'the Thing'
D, because strings are immutable.
200
What is a deque?
A double ended queue.
200
With Linked Lists, what is Floyd's Algorithm used for?
Determining if the linked list has a loop.
200
Convert the binary value 11101111 into hexadecimal.
EF
200
What is the only value in Javascript that is not equal to itself?
NaN
200
// What is the value of x after the following code executes? let words = ['one', 'two', 'three']; let x = words.forEach(function(word) { return word.toUpperCase(); }); A) "ONE TWO THREE" B) ["ONE", "TWO", "THREE"] C) ["one", "two", "three"] D) Undefined
D) Undefined
300
A linked list has been used to implement a queue, which has references to a head node and a tail node. What is the time complexity to insert an element in this queue, if the queue length is n?
O(1)
300
Given the decimal number 23, apply a bitwise right-shift. What is the resulting decimal number?
11
300
// Which one of the following JavaScript expressions return the Boolean value true? A) "peanut butter" && "jelly" B) "2" == 2 C) "yes" || true
B) "2" == 2
300
// When this code is executed, what will be logged to the console? var text = 'outside'; function logIt(){ console.log(text); var text = 'inside'; }; logIt();
undefined
M
e
n
u