Question
You have a list of numbers and need to find the maximum
value. Which of the following approaches would be the most efficient in terms of time complexity?Solution
Iterating through the list once and maintaining a running maximum takes O(N) time, which is the most efficient approach for this problem. Â Â Sorting takes O(N log N). Â Â Binary search tree operations are O(log N) on average, but building it is O(N log N) or O(N^2) worst case. Â Â Hash map is not suitable for finding maximum efficiently.
If a mirror is place on the line XY, then which of the answer figures is the mirror image of the given figure?
ZDEH is related to WFBJ in a certain way based on the English alphabetical order. In 5 the same way, EMOB is related to BOLD. To which of the following ...
Four of the following five are equal in a certain way and form a group.
Which one is not related to that group?
XU, VM, EB, YV, MJ
Ringworm : Skin :: Tapeworm : ?
How many triangles are there in the given figure?Â
Â
Identify the figure given in the options which when put in place of ? will logically complete the series.
Four letter-clusters have been given, out of which three are alike in some manner and one is different. Select the one that is different.
Select the option figure in which the given figure (X) is embedded as its part (rotation is NOT allowed).
Study the given pattern carefully and select the number that can replace the question mark (?) in it.
Select the number that does NOT belong to the given number series.
39, 46, 60, 82, 109, 144