Given a list of numbers ( fixed list) Now given any other
list, how can you efficiently find out if there is any
element in the second list that is an element of the
first list (fixed list)
Answer Posted / karan verma
Above method will be most efficient in terms of time
complexity that is O(n).
If we desire space complexity O(1)
--> sort the two lists O(nlogn)
--> find the missing no. O(n)
O(n+nlogn)=O(nlogn)
space complexity=O(1)
Is This Answer Correct ? | 11 Yes | 7 No |
Post New Answer View All Answers
can you use proc sql to manpulate a data set or would u prefer to use proc report ? if so why ? make up an example and explain in detail
Sir... please give some important coding questions asked by product companies..
How to palindrom string in c language?
How do you verify if the two sentences/phrases input is an anagram using predefined functions in string.h and by using arrays?
how to create a 3x3 two dimensional array that will give you the sums on the left and bottom columns
What is full form of PEPSI
What is data _null_? ,Explain with code when u need to use it in data step programming ?
write a c program to input initial & final time in the format hh:mm and find the time intervel between them? Ex inputs are initial 06:30 final 00:05 and 23:22 final 22.30
write a function to give demostrate the functionality of 3d in 1d. function prototye: change(int value,int indexX,int indexY,int indexZ, int [] 1dArray); value=what is the date; indexX=x-asix indexY=y-axis indexZ=z-axis and 1dArray=in which and where the value is stored??
why do you use macros? Explain a situation where you had to incorporate macros in your proc report? use a simple instream data example with code ?
Set up procedure for generating a wire frame display of a polyhedron with the hidden edges of the object drawn with dashed lines
To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates. String contains only lowercase characters ['a'-'z']
#include
Can you send Code for Run Length Encoding Of BMP Image in C Language in linux(i.e Compression and Decompression) ?
Cluster head selection in Wireless Sensor Network using C programming language.