jQuery Establezca la altura del elemento en la más alta del grupo

Estoy tratando de trabajar con jQuery para encontrar el elemento más alto de los primeros 3 elementos dentro de un div, luego establecer los 3 en la misma altura, luego verificar los siguientes 3 y establecerlos ... etc .. si mi ancho de ventana == X, también Si el ancho de la ventana es <X, entonces encuentre los 2 elementos más altos y luego configúrelos, luego los 2 siguientes y luego los 2 siguientes.

Este es mi código actual que funciona para todos los elementos, me gustaría repasar los elementos en grupos (2 y 3) y establecer la altura de ese grupo según el resultado y el tamaño de la ventana.

// Find highest element and set all the elements to this height.
    $(document).ready(function () {

    // Set options
    var height = 0;
    var element_search = "#cat_product_list #cat_list";
    var element_set = "#cat_product_list  #cat_list";

    // Search through the elements set and see which is the highest.
    $(element_search).each(function () {
        if (height < $(this).height()) height = $(this).height();
        //debug_(height,1);
    });

    // Set the height for the element(s if more than one).
    $(element_set).each(function () {
        $(element_set).css("height", (height+40) + "px");
    });
});

Cualquier ayuda es muy apreciada :)

Respuestas a la pregunta(3)

Su respuesta a la pregunta