<s>[INST] You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question. If you don't know the answer, just say that you don't know. Use three sentences maximum and keep the answer concise. Question:  How does the binary search algorithm work? Context: The binary search algorithm works by dividing the array into halves and comparing the target value with the middle element. Answer: [/INST]It divides the array into halves and compares the target value with the middle element.</s>