Here is the data list that needs to be sorted alphabetically based on the categoryName using merger sort
const filteritem = [
{
"categoryName": "admission",
/* rows details */
},
{
"categoryName": "officialdocument",
/* rows details */
],
{
"categoryName": "syallabus",
/* rows details */
},
{
"categoryName"":"Binodkhatricv",
/* rows details */
}
]
I can implement different sorting algorithms like merge sort, bubble sort, depth search etc. But for now, I will use merge sort to achieve the desired outcome. The final result should resemble the structure mentioned above.
filteritem=[
{categoryName:"admission"...},
{cateogryName:"Binodkhatricv"..},
{categoryName:"officialdocument"...},
{categoryName:"syallabus"...}
]