Note that there are some explanatory texts on larger screens.

plurals
  1. POOne more string implementation in C: advantages and disadvantages
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COJoel isn't actually writing about strings, you know. He uses them merely as an illustration, because any programmer will know them. But his main point is that you should avoid O(N*N) algorithms.
      singulars
    2. CODid not understand a single thing to your representation, and not even the problem you are trying to solve. You want to solve the problem of making strcat() not an O(n*n) algorithm ? There are plenty of ways to do that. If you are planning about writing a real program, I suggest to use existing string structures provided by frameworks such as Qt, Gtkmm, WxWindows, MFC, std::lib . All of them can solve the strcat problems and many more, like unicode conversion and other tricky features.
      singulars
    3. CO<i>You want to , solve the problem of making strcat() not an O(n*n) algorithm</i> Yes, this is one of the tasks. <i>If you are planning about writing a real program,</i> If I write a real program, I would not reinvent a bycicle, surely. This task is only a pure mind game. I think that comparsion of string implementation in C and Pascal is a good sample of different approaches, that has different advantages and disadvantages. And some disadvantages are generated by advantages.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload