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

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.


Come up with an algorithm with a worst case complexity of O(N2).

Now improvise this algorithm, assuming all numbers are positive integers.

What if the numbers could be negative as well? Can you think of an O(nlogn) solution in this case? (Hint: use sorting)


Using binary, find the element of Key 10 in the following array.


10,14,19,26,27,31,33,35,42,44



Write a C++ program to find the sum of integer and float array
elements using function overloading. Dynamic memory allocation
should be used for arrays.
Define a class to represent book with the following details.
Data Members:
Book-No, Book-name, author, publisher, price, No. of copies, No.
Of copies issued.
Member Functions:
a) Assign initial values
b) Issue a book after checking availability
c) Return a book
d) Display book information
Hint- use constructors, static class members
Create a class DATE to read the date and overload ++ (both prefix
and postfix) to generate the next date.
For Example, if d = 15/8/2019 output d++ or ++d should return
16/8/2019. Consider all possible test cases.
Create a class student with name, roll number, marks of 5 subjects
as data variables and use friend functions to read and display
student details.
Overload <, <= , > and > = operators to compare the total marks
scored by the student.
For example, if 40,60,50,50,100 are marks of students S1, and
100,100,100,100,100 are the marks of student S2 then S1 < S2, S1
<= S2 should return true and S1 > S2, S1 >= S2 should return false.

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)  

Viva (Delivery Milestone) Configure a system to allow files to be shared amongst Linux computers. Create three shares: one called Cheese that is read only and restricted to the 192.168.1.0/24 network, one called Pickle with read write access, that permits root privileges and can only be accessed from 192.168.1.1 and one called Crackers that is accessible to 192.168.1.1/24 to 192.168.1.10/24 as read write and everyone else as read only. Ensure that all of these files are shared across an array of 2 disks for reliability. Where additional data may be needed to complete this task, generate this using judgement.



Split an original single linked list into two sub-lists, where the first and second sub-list contains the even position nodes and odd position nodes of the original list respectively, and then join the second sub-list at the end of the first sub-list. Example: If the list contains 3->4->2->1->7->9->8, then the function needs to produce 3->2->7->8->4->1->9.



pairs = [ (x,y) for x in range(5,1,-1) for y in range(4,1,-1) if (x+y)%3 == 0 ]





LATEST TUTORIALS
APPROVED BY CLIENTS