Categories: Homework on time

How to make an insertion sort to sort an array of c strings using the following algorithm: * beg, *

How to make an insertion sort to sort an array of c strings using the following algorithm: * beg, * end){ (end – beg < ) ; * i; * j; * k; t; (i = beg; i != end; ++i) {t = *i; (k = i, j = k--; j != beg && t < *k; --j, --k)*j = *k;*j = t; }}I created a bool DictionaryLT(const char* s1, const char* s2) to determine when s1 is greater than s2. I have my bool indicate true when s2 is greater than s1. This is what I reworked using the algorithm above, but I'm not getting the correct out. How does the algorithm work step by step? Did I set my pointers correctly?void DictionaryStringSort (char* *beg, char* *end){ if (DictionaryLT(*beg, *end) == false) return;    char * i;    char * j;    char * k;    char  t;    for(i = *beg; i != *end; ++i){      t = *i;      for (k = i, j = k--; j != *beg && t < *k; --j, --k)        *j = *k;      *j = t;    }}

Don't use plagiarized sources. Get Your Custom Essay on
How to make an insertion sort to sort an array of c strings using the following algorithm: * beg, *
Just from $13/Page
Order Essay
superadmin

Recent Posts

Consider the following information, and answer the question below. China and England are internation

Consider the following information, and answer the question below. China and England are international trade…

3 years ago

The CPA is involved in many aspects of accounting and business. Let’s discuss some other tasks, othe

The CPA is involved in many aspects of accounting and business. Let's discuss some other…

3 years ago

For your initial post, share your earliest memory of a laser. Compare and contrast your first percep

For your initial post, share your earliest memory of a laser. Compare and contrast your…

3 years ago

2. The Ajax Co. just decided to save $1,500 a month for the next five years as a safety net for rece

2. The Ajax Co. just decided to save $1,500 a month for the next five…

3 years ago

Assume the following Keynesian income-expenditure two-sector model:

Assume the following Keynesian income-expenditure two-sector model:                                                AD = Cp + Ip                                                Cp = Co…

3 years ago

Do students who learned English and another language simultaneously score worse on the SAT Critical

Do students who learned English and another language simultaneously score worse on the SAT Critical…

3 years ago