divide-and-conquer

How to create node set from values

How can we create a node set from values.... I have n numbers 1,2,3.......n. I want to create a node set <MYNMUMS> <MYNUM>1</MYNUM> <MYNUM>2</MYNUM> <MYNUM>3</MYNUM> <MYNUM>4</MYNUM> .... <MYNUM>N</MYNUM> </MYNMUMS> ...

divide and conquer and recursion

I wonder if the technique of divide and conquer always divide a problem into subproblems of same type? By same type, I mean one can implement it using a function with recursion. Can divide and conquer always be implemented by recursion? Thanks! ...

nth smallest number among two databases of size n each using divide and conquer

we have two databases of size n containing numbers without repeats. So, in total we have 2n elements. They can be accessed through a query to one database at a time. The query is such that you give it a k and it returns kth smallest entry in that database. we need to find nth smallest entry among all the 2n elements in O(logn) queries. t...

Rails : fighting long http response times with ajax. Is it a good idea? Please, help with implementation details.

Hi, everybody! I've googled some tutorials, browsed some SO answers, and was unable to find a recipe for my problem. I'm writing a web site which is supposed to display almost realtime stock chart. Data is stored in constantly updating MySQL database, I wrote a find_by_sql query code which fetches all the data I need to get my chart dr...

Full-Text Indexing/Searching for Paging

Greetings Overflowers, I'm currently not using full-text indexing/searching capabilities of any relational database engine. This is because they do not satisfy my application complex query requirements: searching by Arabic root/template/stem/diacritics... etc ("/" stands for and/or) using logical operators between them (in 1) such as ...

How can I speed up my 'divide and conquer' XSLT template which replaces certain characters in a string?

UPDATE: I added an answer to this question which incorporates almost all the suggestions which have been given. The original template given in the code below needed 45605ms to finish a real world input document (english text about script programming). The revised template in the community wiki answer brought the runtime down to 605ms! I...

Tricky algorithm question

Possible Duplicate: Quickest way to find missing number in an array of numbers Input: unsorted array A[1,..,n] which contains all but one of the integers in the range 0,..,n The problem is to determine the missing integer in O(n) time. Each element of A is represented in binary, and the only operation available is the functio...