Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
Given 20 GB of data (normally numbers) and you have only 1GB of RAM, How will you sort the data?
You can use something similar to merge sort.
Sort 20 groups of numbers and write them to disk. Once their sorted read from all groups simultaneously using a buffer and print out the ordered master set. For this last merge step you should only need constant memory.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 days ago.
Improve this question
Let 𝑛 > 1 identical containers, one of them with 𝑊 liters of water and the rest empty. You are allowed to perform the following action: take two of the containers and divide the total amount of water in them equally between them. The objective is to achieve the minimum possible amount of water in the container containing all the water of the original arrangement by a sequence of the above actions of transferring water from container to container.
What is the best way to do this? How many actions will be required? Can I have an algorithm?
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 5 months ago.
Improve this question
So, say you have 2 sets with unknown properties. So the order and the size of each set is unknown. How would we merge and sort these 2 sets into one set?
The solution I have is to simply add the 2 sets into one set and perform a merge sort.
I feel as if there is a better way. Does anyone have any ideas?
Typically you would concatenate the sets and then sort them as a single set, that is almost as simple as it gets. I'm guessing you are using Python for this if that's the case you can use function sorted().
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I want to align a pair of long texts with ~20M chars each.
I've used in the past Smith-Waterman algorithm but (from my limited understanding) it requires creating a 2-dimensional array with the size of the texts (20M by 20M array) - which is not practical.
So I'm looking for an algorithm to align a pair of long texts that will keep a practical memory size and execution time.
UPDATE
I've also tried Myers and Miller using this implementation: https://www.codeproject.com/Articles/42279/Investigating-Myers-diff-algorithm-Part-of
But I still got out of memory exception on "not so large" texts (1MB).
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
What is the data model to store millions of record efficiently in the aerospike database?
Use case : storing millions of bid(value) for a particular id(key) and
also need to iterate over the values and operate on them as fast as possible and store them separately.
Currently :using set as the key and bin as the value.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I had this question on my exam today.
Choices were: 1)Merge sort 2)Quick sort 3)insertion sort 4)bubble sort 5)selection sort
I had a feeling that the answer is either 1 or 2, but I don't know which one it is. It seems merge sort and quick sort wouldn't stop at the middle. Can someone explain the reason of the answer you pick?
The merge sort is called with (i.e. sorts) half the data on each recursive call. The data need not be duplicated, however.