Questions: 11 448

Answers by our Experts: 10 707

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

Algorithmic Problem

You are given the arrival and leaving times of n customers in a restaurant.

What was the maximum number of customers?

Input

The first input line has an integer n: the number of customers.

After this, there are n lines that describe the customers. Each line has two integers a and b: the arrival and leaving times of a customer.

You may assume that all arrival and leaving times are distinct.

Output

Print one integer: the maximum number of customers.

Example

Input:

3

5 8

2 4

3 9

Output:

2



Write a program to create a class to store details of a student ( name, roll and 3 subject marks ). Input details for 2 students and assign all the details of that student who is having higher average mark to a new student.

i) use member function

ii) use friend function

Write a program to create a class to store details of a student ( name, roll and 3 subject marks ). Input details for 2 students and assign all the details of that student who is having higher average mark to a new student.

i) use member function

ii) use friend function

Essay on system functionality
write a c++ program to display your name,mobile no,reg no,college studying and address...
Create a class which stores name, roll no and total marks for a student. Input data for 11 students. Find the average marks scored by n students, store it as a data member of the class and display it using a function which may be called without object.

For each of the following, write a single statement that performs the single task. Define two integer

variables val1 and val2. Initialize the val1 to 2300.

1. Define a pointer myPointer to an object of type integer.

2. Assign the address of variable val1 to pointer.

3. Print the value of the object pointed to by myPointer.

4. Assign the value of the object pointed to by myPointer to variable val2.

5. Print the value of val2.

6. Print the address of val1.

7. Print the address stored in myPointer



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)


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
LATEST TUTORIALS
APPROVED BY CLIENTS