# Algorithm, Code, Quiz, Math, Simple, Programming, Easy Questions

This project was successfully completed by **mahmoudhanafy92** for **$44 USD** in a **day**.

###### Project Budget

$30 - $250 USD###### Completed In

1 day###### Total Bids

16###### Project Description

Hello,

I am looking for some one who can code excellent algorithms, have clear concepts in programming, good with data structures and can code with good design.

Who has good understanding about Big O notations and time/space complexity. If you can answer below questions, and provide support (online) for an hour. You will be awarded this project and good money, excellent feedback and bonus on good work. I am 5.0/5.0 employer. I will create 100% Milestone Money. It will be fun, exciting to work together.

****** Please Refer to the attached File.

BASIC ALGORITHMS

1. What is the best data structure to implement priority queue?

2. What are the worst case time complexity of the following algorithms, performed on containers of size N:

(a) Locating a number in an unsorted array.

(b) Locating a number in a sorted array.

(c) Inserting a number in a balanced binary tree

(f) Deleting a number from an unbalanced binary tree

(g) Building a heap

(h) Adding a number to a hash table

(i) Sorting an array

3. What is the relation (less, greater, equal) between O(n) and O(2n)? O(log2 N) and O(log10 N)?

CODING

EXPECTED TIME TO COMPLETE: 20-30 minutes

1. In a two dimensional array of integers of size m x n, for each element which value is zero, set to zero the entire row and

the column where this element is located, and leave the rest of the elements untouched.

2. Write a function that takes an integer argument and returns the corresponding Excel column name.

For instance 1 would return 'A', 2 would return 'B', ...., 27 would return 'AA' and so on

3. Write code to merge 3 sorted arrays of integers (all different sizes) into a single sorted array.

DEBUGGING

1. Find the bug in the following code:

// Find the first break in monotonically increasing sequence Returns c if there is no break.

int r(int *p, size_t c)

{

int i = 0;

while(p[i + 1] >= p[i] && i < c - 1)

++i;

return i + 1;

}

MATH, PROBABILITY, COMPLEXITY

1. A rare disease afflicts 1% of the population. A medical test for this disease has 1% false positive rate (if a person is healthy, there is a 1% probability that the test will show that the person is ill), and 1% false negative rate (if a person is ill, there is a 1% probability that the test will that the person is healthy). A person tests as having the disease. What is the probability that the person actually has the disease?

2. An evil dictator captured you and made you play a game. You are in front of three glasses of wine. Two of them are poisoned; one is not. You must pick one can and drink it. If you survive, the evil dictator will release you. When you pick one of the glasses, the dictator reveals which one of the other two is poisoned, and offers you to stay with your original choice, or switch. Should you switch?

3. In front of you there is a black box. The box can perform two operations: push(N) adds a number to its internal storage; pop-min() extracts the current minimum of all numbers that are currently stored, and makes the box forget it. The numbers are mathematical objects: there is no upper bound. Both push(N) and pop-min() execute in O(1) time. Design and algorithm that could be used to implement such a box.

4. You are asked to design a plotter. A plotter is a computer-controlled device that picks a pen, carries it to a point on paper using mechanical maniplator, lowers it so that it touches the paper, and drags it to the next point drawing a line. In your plotter there will be 3 pens, red, green, and blue. Computer uploads a picture to the plotter which consists of list of segments and colors in which these segments must be drawn. You are asked to reorder the segments such that the work performed by mechanical manipulator is optimal.

Can you design an algorithm that would do so?

5. What is the time complexity of the following algorithm:

unsigned int Rabbits(unsigned int r)

{

return (r < 2) ? r : Rabbits(r - 1) + Rabbits(r - 2);

}

### Looking to make some money?

- Set your budget and the timeframe
- Outline your proposal
- Get paid for your work

## Hire Freelancers who also bid on this project

## Looking for work?

### Work on projects like this and make money from home!

Sign Up Now- Forbes
- The New York Times
- Time
- Wall Street Journal
- Times Online