Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

determine the cumulative sum of n floating point numbers read a new number into the computer during each call to recursive function
Sample input:
n=3
Enter the number:0.8
Enter the number:0.1
Enter the number:0.2
Sample output:
Cumulative sum=1.1
given a string "programming" and find the first occurrence of the vowel and move the sequence of consonants preceding the first vowel to the end of the string
Sample input:
Str[]=programming
Sample output:
Updated string=ogrammingpr
given an input string Ayodhya your C program to count the number of vowels and consonants and print the frequency of occurrence of each vowel and consonant delete the vowels in the same input string and display the updated string
Sample input:
Enter the input string: Ayodhya
Sample output:
No of vowels:3
Frequency of occurrence:A-2;o-1
No of consonants:4
Frequency of occurrence:y-2;d-1;h-1
give a one dimensional array with positive integer values rearrange the array such that the odd numbers precede the even numbers
Sample input:
Numbers [10]={5,7,9,98,3,65,54,2,13,15}
Sample output:
Rearranged array={5,7,9,3,13,65,15,98,54,2}

Akshita loves chocolates, numbers and algorithms. Her friends Ina and Mina gave her a and b chocolates respectively.  Given her love for numbers, she likes all the numbers that are divisible by either ‘a’ or ‘b’ or both. She wants to find the nth smallest such number that is divisible by either a or b. Suggest her an algorithm to find the desired number, describe the principle on which the algorithm is based, write the pseudocode and the recurrence relation for the same. Also state which subproblem will give the answer to the original problem.

Expected Complexity → O(log(N∗min(A,B))).  

Assume a and b to be co-prime positive integers. 




Rahul lives in City A and would like to travel to City B for work. There is a shuttle service for people in these cities which has a fixed schedule. The schedule for City A is a list of boarding times(at City A) and departure times(from City A) for each bus.

Note: No one is allowed to board a shuttle after the boarding time.

He arrives at time t and sometimes has to wait at the station. You are given a list of arrival times for n days.

  1. Devise an algorithm to find him the shuttle with the least waiting time. (waiting time  = boardingj - t ,  where j is the next shuttle. And boardingj  >= t ) for each ti
  2. If he also has access to the travel time of each shuttle. Can you help him find the shuttle which will help him reach his destination at the earliest ?

Return an array of shuttle indexes that Rahul took for n days.




Harry loves numbers in the range [m1, m2] (m1 and m2 included). carry decides to gift harry an array of numbers for his birthday. harry wants to find the number of pairs of indices [l, r] for which the sum of all the elements in the range [l, r] lies between m1 and m2.   

  1. Come up with an algorithm with a worst case complexity of O(N2).
  2. Now improvise this algorithm, assuming all numbers are positive integers.  
  3. What if the numbers could be negative as well? Can you think of an O(nlogn) solution in this case? (Hint: use sorting)  
given an input string Ayodhya your C program to count the number of vowels and consonants and print the frequency of occurrence of each vowel and consonant delete the vowels in the same input string and display the updated string
Sample input:
Enter the input string: Ayodhya
Sample output:
No of vowels:3
Frequency of occurrence:A-2;o-1
No of consonants:4
Frequency of occurrence:y-2;d-1;h-1
given a string "programming" and find the first occurrence of the vowel and move the sequence of consonants preceding the first vowel to the end of the string
Sample input:
Str[]=programming
Sample output:
Updated string=ogrammingpr
write a program to get 5 single digit numbers in an array and form a number using the array elements (use function with array as argument and return the number)
Sample input:
Numbers [5]={1,2,3,4,5}
Sample output:
Number=12345
LATEST TUTORIALS
APPROVED BY CLIENTS