JS Algo Questions Flashcards
1
Q
what does split function do ?
A
converts a string into an array of characters
2
Q
how can you convert a string into an array of characters ?
A
split method
3
Q
how can you reverse the order of elements in an array ?
A
using the reverse method
4
Q
how can you convert an array into a string
A
join method
5
Q
for a binary tree implementation, what should the properties of a node object be ?
A
value, left and right
6
Q
Name two algorithms on which the sort method is based off.
A
quicksort or mergesort
7
Q
what is the worst case time complexity of the sort method in javascript ?
A
O(n log n)