I recently acquired 2 sleeves of golf balls that appear to be brand new, but I have never heard of them. On the sleeve it says PGA Victor and on the ball itself it has the initials PGA. Can you tell me anything about this ball?
Read Answer(1) | 1,332 Views |
Implement the following function for sorting a linked list of integers in ascending order. The function takes a pointer to the head of the list, and returns a pointer to the head of the sorted list. Your function should use only a constant amount of memory. It’s prohibited to change the value of ListNode, instead ListNodes must be rearranged. struct ListNode{ int value() { return _value; } ListNode *pNext;private: int _value;}; ListNode* SortList(ListNode *pHead){ // Insert your implementation here}
I need this implementation code
Read Answers(2) | 5,410 Views |
Which is better, a higher salary or a better company?
Read Answers(19) | 7,870 Views |
Where do you want to be in 5 years?
Read Answers(14) | 8,010 Views |
There is a planet more than thousand light years away from earth. They have a big
problem, because they still don’t have a police force and laws, and people are fighting
for land.
There are N (2 <= N <= 1000) people living in this planet. Every person has an
ID number from 1 to N and no two persons will have the same ID number. When they
fight the stronger one wins and the weaker loses. There are M (1 <= M <=
1000) fights going on.
You
are given the strength of each person and the fighting pairs and you have to
determine the winner of each fight.
Input (fight.in)
1. First line contains N and M.
2. Each of the next N Lines contains one integer Pi (1
<= Pi
<= 2000) which is the strength the ith
person.
3. Next M lines contains two integers x and y (1 <= x, y <= N), the ID
numbers of the fighting pair.
Output (fight.out)
Example Input
4 4
1
3
5
2
1 2
2 3
3 4
1 4
Example Output
2
3
3
4
Read Answer(1) | 2,295 Views |
People in a certain island want a modern airport. This island has the shape of a
square with side length L (1 <= L <= 10). Its top left corner is at X, Y
(0 <= X, Y <= 50) and the right bottom corner is at X+L, Y+L. They have a
list of N (0 <= N <= 20) existing airports and their locations which they
need to visit frequently. These may be
situated inside this island or outside. Any number of airports can be situated
at the same coordinate position.
The aircraft fly only along grid lines for safety reasons. For example the distance
between (4, 6) and (7, 5) is 7-4+6-5 = 4. The top left corner of the grid is 0,
0. X axis increases from 0, left to right and Y axis increases from top to
bottom from 0. All the airports including the new one are located on grid
points. The total cost of traveling is the sum of the distances to all the other
airports from the new airport. They want the new airport to be located so
that the total cost of traveling is minimized.
Your
task is to find the total cost T of traveling when the airport is built at the
location where the total cost is minimized.
Input (Standard
Input)
1. First Line will be four integers X, Y, L and N.
2. Each of the next N Lines will contain two integers x, y (0 <= x, y
<= 100), the coordinates of an existing airport.
Output (Standard
Output)
Example Input
2 3 2 4
0 0
4 3
5 5
3 4
Example Output
12
Read Answer(1) | 1,310 Views |
Crimes are frequent in a planet far away from earth. So the people there have decided to form a
police force and they want the oldest five persons to be the police officers. Because there are many people in this village, they want you to write a program to find the oldest five.
Input (police.in)
1. First line contains N (5 <= N <= 1000).
2. Each of the next N lines contains Ai which is the age of the ith person. The ID number of
the ith person is also ‘i’.
Output (police.out)
Example Input
10
10
3
20
100
50
11
15
25
60
75
Example Output
4
10
9
5
8
Read Answer(1) | 1,151 Views |
In turbo c when we declare an uninitialized pointer, it stores some garbage value. In all the case i have seen that the data in that garbage memory address is 767 irrespective of the garbage address it is pointing.
why????
Read Answer(1) | 4,931 Views |
What is C++ programming?
Read Answers(7) | 3,512 Views |