Edit On second thoughts, and after reading the answers, I realised that I had misinterpreted the statement from the book. As such, in hindsight, this wasn't a good example for the question. Regardless, my original question is still not answered, so I will try with a new example.
Is it correct to connect a question with a statement (as in below example), and if so, should the sentence end with a question mark or a full stop?
Do you want to have some ice cream and your English homework is due tomorrow?
The point I am trying to make is that "question part" has no connection to the statement which follows.
I found this question/statement in a book.
What is the running time of BFS if we represent its input graph by an adjacency matrix and modify the algorithm to handle this form of input? This connects a question (What is the running time of BFS if we represent its input graph by an adjacency matrix) and a statement (modify the algorithm to handle this form of input). Is it correct to place the question mark at the end?
Note: Despite the similar sounding title, this question is different from Question and a sentence in the same sentence.