Skip to main content
Code Review

Return to Answer

replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
  • The code does not implement the permuted index. Instead of

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox
    

    it produces

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
    

    Notice that the order is wrong. The permuted index shall be sorted by the second column.

  • using namespace std; is considered bad practice considered bad practice.

  • Never #include a .cpp file. See for example this discussion this discussion for details.

  • Try not use so many strings. It hurts both memory usage and performance. In fact there is no need to break the initial string into words and reconstruct left and right strings. A vector of whitespace locations in the original string suffices.

  • The code does not implement the permuted index. Instead of

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox
    

    it produces

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
    

    Notice that the order is wrong. The permuted index shall be sorted by the second column.

  • using namespace std; is considered bad practice.

  • Never #include a .cpp file. See for example this discussion for details.

  • Try not use so many strings. It hurts both memory usage and performance. In fact there is no need to break the initial string into words and reconstruct left and right strings. A vector of whitespace locations in the original string suffices.

  • The code does not implement the permuted index. Instead of

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox
    

    it produces

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
    

    Notice that the order is wrong. The permuted index shall be sorted by the second column.

  • using namespace std; is considered bad practice.

  • Never #include a .cpp file. See for example this discussion for details.

  • Try not use so many strings. It hurts both memory usage and performance. In fact there is no need to break the initial string into words and reconstruct left and right strings. A vector of whitespace locations in the original string suffices.

added 247 characters in body
Source Link
vnp
  • 58.6k
  • 4
  • 55
  • 144
  • The code does not implement the permuted index. Instead of

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox
    

    it produces

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
    

    Notice that the order is wrong. The permuted index shall be sorted by the second column.

  • using namespace std; is considered bad practice.

  • Never #include a .cpp file. See for example this discussion for details.

  • Try not use so many strings. It hurts both memory usage and performance. In fact there is no need to break the initial string into words and reconstruct left and right strings. A vector of whitespace locations in the original string suffices.

  • The code does not implement the permuted index. Instead of

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox
    

    it produces

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
    

    Notice that the order is wrong. The permuted index shall be sorted by the second column.

  • using namespace std; is considered bad practice.

  • Never #include a .cpp file. See for example this discussion for details.

  • The code does not implement the permuted index. Instead of

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox
    

    it produces

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
    

    Notice that the order is wrong. The permuted index shall be sorted by the second column.

  • using namespace std; is considered bad practice.

  • Never #include a .cpp file. See for example this discussion for details.

  • Try not use so many strings. It hurts both memory usage and performance. In fact there is no need to break the initial string into words and reconstruct left and right strings. A vector of whitespace locations in the original string suffices.

Source Link
vnp
  • 58.6k
  • 4
  • 55
  • 144
  • The code does not implement the permuted index. Instead of

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox
    

    it produces

     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
     The quick brown fox 
    

    Notice that the order is wrong. The permuted index shall be sorted by the second column.

  • using namespace std; is considered bad practice.

  • Never #include a .cpp file. See for example this discussion for details.

lang-cpp

AltStyle によって変換されたページ (->オリジナル) /