JS Algo Questions Flashcards

1
Q

what does split function do ?

A

converts a string into an array of characters

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

how can you convert a string into an array of characters ?

A

split method

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

how can you reverse the order of elements in an array ?

A

using the reverse method

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

how can you convert an array into a string

A

join method

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

for a binary tree implementation, what should the properties of a node object be ?

A

value, left and right

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

Name two algorithms on which the sort method is based off.

A

quicksort or mergesort

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

what is the worst case time complexity of the sort method in javascript ?

A

O(n log n)

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