1

the question is derived from that post

here is a long sentence to describe a question on that post.

this piece of code used to demonstrate algorithm complexity and Measuring the Run Time of an Algorithm comes from a book FUNDAMENTALS OF PYTHON: FROM FIRST PROGRAMS THROUGH DATA STRUCTURES

does this long sentence need to be split into following 2 to make things more clear?

this piece of code used to demonstrate algorithm complexity and Measuring the Run Time of an Algorithm.

this piece of code comes from a book FUNDAMENTALS OF PYTHON: FROM FIRST PROGRAMS THROUGH DATA STRUCTURES.

this one looks better?

the book FUNDAMENTALS OF PYTHON: FROM FIRST PROGRAMS THROUGH DATA STRUCTURES inspires me the following piece of code

...code snippet

which can be used to demonstrate algorithm complexity and Measuring the Run Time of an Algorithm

  • I would not consider this sentence long. I do think it needs some commas, to help the reader parse each clause, but there is popular debate about whether commas are appropriate for this purpose. – Frank Thomas Jun 12 '19 at 5:07
2

No, it doesn't need to be split, but you definitely have to correct the grammar to clarify what you want to say. I have no idea why you've highlighted "measuring the run time of an algorithm" since this is a description, not a title.

Instead, I would just list (as a parallel structure) the two things the code does:

This code snippet can be used to demonstrate algorithm complexity and measure algorithm run time.

To connect it to the second part (the source inspiration), use a non-restrictive clause:

This code snippet, which can be used to demonstrate algorithm complexity and measure algorithm run time, was inspired by the book "FUNDAMENTALS OF PYTHON: FROM FIRST PROGRAMS THROUGH DATA STRUCTURES".

Or the other way around:

This code snippet, which was inspired by the book "FUNDAMENTALS OF PYTHON: FROM FIRST PROGRAMS THROUGH DATA STRUCTURES", can be used to demonstrate algorithm complexity and measure algorithm run time.

Or even a simple conjunction:

This code snippet was inspired by the book "FUNDAMENTALS OF PYTHON: FROM FIRST PROGRAMS THROUGH DATA STRUCTURES", and can be used to demonstrate algorithm complexity and measure algorithm run time.

Of course there are dozens of other ways to phrase this sentence, but hopefully one of these should serve.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy