473,657 Members | 2,401 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

divide and conquer

Hello,

I am working on the following problem. I need a divide and conquer
algorithm to solve the following problem. Any help is appreciated.

I have a set of coordinates (x,y) and each coordinate has an ID and
load factor. The load factor is a count of all the coordinates that
are northeast of a point (x,y) (i.e. all points (x_i,y_i) such that
x_i>=x and y_i>=y). Does anyone know a divide and conquer algorithm i
can use to compute the load factors for the set of coordinates?

Example:
If the user input the following coordinates, the program needs to
output the listed loadfactors:

ID coordinate load factor
12 (3,3) 1
10 (4,2) 1
13 (5,6) 0
7 (2,1) 3
Jul 17 '05 #1
4 5961
Jack Smith wrote:

< Jack's homework removed>


Jack, sooner or later you're going to have to try and do some of your
homework on your own. Your questions are all very interesting, but it is
not considered good form to post such questions on usenet, and if you do
insist on posting them then perhaps you should be more upfront and
honest about it.
Jul 17 '05 #2
And you should show that you have done some work yourself.
"Steve" <st***********@ hotmail.com> wrote in message
news:3f******** *************** @lovejoy.zen.co .uk...
Jack Smith wrote:

< Jack's homework removed>


Jack, sooner or later you're going to have to try and do some of your
homework on your own. Your questions are all very interesting, but it is
not considered good form to post such questions on usenet, and if you do
insist on posting them then perhaps you should be more upfront and
honest about it.

Jul 17 '05 #3
st*******@yahoo .com (Jack Smith) wrote in message news:<20******* *************** ****@posting.go ogle.com>...
Hello,

I am working on the following problem. I need a divide and conquer
algorithm to solve the following problem. Any help is appreciated.

I have a set of coordinates (x,y) and each coordinate has an ID and
load factor. The load factor is a count of all the coordinates that
are northeast of a point (x,y) (i.e. all points (x_i,y_i) such that
x_i>=x and y_i>=y). Does anyone know a divide and conquer algorithm i
can use to compute the load factors for the set of coordinates?

Example:
If the user input the following coordinates, the program needs to
output the listed loadfactors:

ID coordinate load factor
12 (3,3) 1
10 (4,2) 1
13 (5,6) 0
7 (2,1) 3


Okay,i will give you some not-direct hints:
please foget(!) about "divide and conquer" and "ID",
and try to find solution yourself.Maybe you will find D&C,maybe not .

It's take 2 or 5 minutes for me to find solution(algo)( heh,for some
money($100...) i will tell you how ;-).

I personally HATE tendency to name things
"find divide and conquer algorithm" instead of
"not slower than o(n*log n)".
Because
1: divide and conquer may work as o(n^m * log n) where m may be >2
("hint" 2 ;-)

2: while not proved that o(n*log n) is a fastest,faster is
"possible"( but here it's proved).
Dmytry Lavrov.

--
solutions:
http://DmytryLavrov.narod.ru
Jul 17 '05 #4
st*******@yahoo .com (Jack Smith) wrote in message news:<20******* *************** ****@posting.go ogle.com>...
Hello,

I am working on the following problem. I need a divide and conquer
algorithm to solve the following problem. Any help is appreciated.

I have a set of coordinates (x,y) and each coordinate has an ID and
load factor. The load factor is a count of all the coordinates that
are northeast of a point (x,y) (i.e. all points (x_i,y_i) such that
x_i>=x and y_i>=y). Does anyone know a divide and conquer algorithm i
can use to compute the load factors for the set of coordinates?

Example:
If the user input the following coordinates, the program needs to
output the listed loadfactors:

ID coordinate load factor
12 (3,3) 1
10 (4,2) 1
13 (5,6) 0
7 (2,1) 3

oops,
after another 2 minutes (of waiting while photoshop loads) i found
another,elegant and simplest possible solution.
free hint:
you should completly foget about D&C,to find this divide and conquer
solution!

solution cost:
200$

my email here:
http://dmytrylavrov.narod.ru
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
12517
by: Nobody | last post by:
I have some code that I am trying to optimize for speed... trying to squeeze every last CPU cycle out... I remembered an old trick where dividing & multiplying can be sped up by using bitshifts and addition / subtraction instead (doing this saved me about 11% time on my 2.26ghz P4). Really easy with powers of two. I implemented this last night when I was tired, and this morning, I realize it was not exactly right (values were slightly...
5
9822
by: per.nordlow | last post by:
Hey there! I want to multiply/divide (shift) a float with variable containing a power-of-two value: 2, 4, 8, 16, .... Is there such a function in the C standard library or the glibc library that does this? If not has anybody written some clever high-performance "hack" like: 1. Cast float pointer to a 32-bit integer pointer.
1
2417
by: urvi | last post by:
Hi... following is a problem i need to solve using divide and conquer method(recursive)..can anybody help me..? You are to organize a tournament involving n teams. Each team must play each possible opponent exactly once. Moreover, each team must play exactly one game per day. If n is a power of 2, design a recursive divide-and- conquer algorithm to construct a timetable allowing the tournament to finish
4
5135
by: shuisheng | last post by:
Dear all, Assume I have two big arrays A and B. And I want to element-wise divide A by B. When an element of B is zero, the results are also zero. Such as A = { 2, 4, 0, 6} B = { 1, 0, 0, 2} ----------------------------------------- R = { 2, 0, 0, 3}
40
3626
by: Spiros Bousbouras | last post by:
Do you have an example of an implementation where sizeof(short int) does not divide sizeof(int) or sizeof(int) does not divide sizeof(long int) or sizeof(long int) does not divide sizeof(long long int) ? Same question for the corresponding unsigned types.
1
4601
by: Justin.Velazquez | last post by:
Hello everyone, I'm not really new to programming but my bitwise skills definately need work. I came across a problem I've been trying to figure out for fun. I'm trying to write a routine that will divide a number by 7 without using the divide operator. I figured how to multiply by 7 using bitwise operators ( (x << 3) - x ) but I having
1
2945
by: nadine | last post by:
I need some help writing an algorithm (pseudocode is fine too) for a divide-and-conquer technique for determining the position of the max element in an unsorted array. Any help would be appreciated
12
7062
by: rajm2019 | last post by:
Without using /,% and * operators. write a function to divide a number by 3. itoa() function is available
5
3942
by: seemanikam | last post by:
Can anyone suggest me how to devise an efficient divide-and-conquer algorithm for the Tower-of-Hanoi problem when the disks are colored alternately red and blue, and with the extra rule that no disk may be placed on any other disk of the same color.
0
8315
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8829
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8508
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8608
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2733
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1627
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.