Parallel Merge Sort – No memory allocation

I am implementing a parallel merge sort in C++ that is based off P-Merge-Sort algorithm from Introduction to Algorithms, CLRS on page 803. Here’s the algorithm: P-Merge-Sort

And the associated algorithms:



And my problem is that I am trying avoid creating a $ T[1 \, ..\, n]$ for each invocation of P-Merge-Sort. I am told that it should be done via global arrays. So I have tried utilizing a single array for working which is the same size as the array being sorted where it would be used as ‘B’ in P-Merge-Sort.

How can I make this work without dynamically allocating memory during Merge Sorting?

Update list item using REST Merge, but field names are ambiguous

I have a sharepoint online list which I am updating via javascript in the same sharepoint site. The list has two similarly named columns: Display name: “Learner Score” Internal name:”LearnerScore” Display name: “Learner Score %” Internal name:”LearnerScorePercent”

I am updating the fields via a REST merge, and when I specify the data value, I have to use “LearnerScore” for the “LearnerScore” field and “LearnerScore0” for the “LearnerScorePercent” field.

I have found that this method of specifying the field is ambiguous – if I add a third column with display name “Learner Score%”(no space) and internal name “LearnerScoreTest” – I must specify field name of “LearnerScore1” in my REST data.

This is causing some confusion for me in the code, plus the code must be changed if we change the display name.

Is it possible to specify the Internal name of the field in the data parameter?

my update function:

UpdateEntry(1,"{'Learner0':'40'}"); function UpdateEntry(itemId,itemData){             var url=""+itemId+")";         $  .ajax({         type: 'POST',         url: url,         contentType: 'application/json',         processData: false,                 data:itemData,         headers:{             "Accept":"application/json;odata=verbose",             "X-RequestDigest":$  ("#__REQUESTDIGEST").val(),             "X-HTTP-Method":"MERGE",             "If-Match":"*"         },         success: function (data) {             alert('success');          },         error: function(data){             alert('error');         }     }); } 

git merge vs rebase

Soy un no iniciado en git, y me surge una duda.

Tenemos un branch MASTER del proyecto en el que estoy desarrollando, y he abierto un branch para realizar cambios locales. Mientras tanto, en el branch MASTER se han realizado commits de otros miembros del proyecto.

Mi pregunta es, cual es el mejor método para incorporar esos cambios a mi branch sin necesidad de actualizar el branch MASTER?

Y una vez terminado mis cambios, como paso mis cambios al branch MASTER? lo pregunto porque en algún caso hemos perdido commits del branch MASTER, desconozco que hicimos mal, pero se perdieron cambios por el camino.


Merge and edit two cell phone videos for

I have two cell phone videos the first 45 seconds and the second 30 seconds. I would like to merge them together and upload to I also need to insert introductory video leaders:

  • a 3 second introductory clip “This is before repair”
  • first video of 45 seconds
  • a 3 second introductory clip “This is after repair”
  • second video

What tools are available to create this video in Ubuntu 16.04 (I also have Ubuntu 19.04 installed)?

Note: I didn’t specify a video file format when I made the two videos on my cell phone but it is running Android 7 I believe.

Is there a name for the technique used in the “merge” part of MergeSort?

MergeSort has two parts, “divide” and “merge” (arguably three if you include “recurse” as its own part in the middle). I’m interested in the “merge” part, which tends to look like this:

consider two priority queues list1, list2 initialize an empty sorted list while neither list1 nor list2 is empty:     find lowest element between peek(list1) and peek(list2)     pop that element from its list and add it to the sorted list add the rest of the non-empty list to the sorted list return the sorted list 

This paradigm of “split into multiple priority queues and continuously handle the first elements” is also useful for problems that decidedly do not involve merging, such as performing operations on one list depending on the highest-priority element of another list that’s less than it. For example,

consider two priority queues list1, list2 initialize an empty destination list while neither list1 nor list2 is empty:     while peek(list1) < peek(list2):         add f(peek(list1), peek(list2)) to destination list         pop element from list1     pop element from list2 return destination list 

In both of these examples, the same idea of “iterate through multiple priority queues simultaneously, doing something with the top elements of each, but only pop one of them at a time” is used. This is different than matching two lists and enumerating through corresponding elements.

Is there a specific name for this technique/paradigm? The Wikipedia page for MergeSort does not, at time of writing, answer the question, and in the context of MergeSort I’ve never seen it described as anything other than “merge” (which is inaccurate in my second example) or “conquer” (which is too vague).

Difference between Quick sort, Merge sort and Heap sort

We know all the above-mentioned sorting algorithms take $ \mathcal{O}(\mbox{N log N})$ . Merge sort and Heap sort algorithms take $ \mathcal{O}(\mbox{N log N})$ time in worst-case where Quicksort takes $ \mathcal{O}(\mbox{N}^2)$ . So what is the main difference between these algorithms? Which algorithm is preferable for sorting at any time?

Actually, I have been asked this in an interview. I replied Merge sort is not good with space. So we can consider Quicksort. But I couldn’t figure out the difference between quick sort and heap sort. I need your help to figure it out.

Negacion de merge en git

Cree un proyecto de React con create-react-app desde el ordenador del trabajo y lo subi a mi Git… por defecto el push de este no sube al git todas las dependencias instaladas solo sube una parte de los archivos.. pense lo siguiente para hacer el pull en mi ordenador creo otra otro proyecto con create-react-app y luego hago un pull desde me repositorio, asi este me actualizara los cambios que hice… comienza a hacerlo pero al final me muestra el siguiente error:

* branch            master     -> FETCH_HEAD fatal: refusing to merge unrelated histories 

Hay alguna forma de arreglar esto.. o cuando subo un proyecto react a git y lo clono debo hacerlo de una forma especifica?