<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 a binary search algorithm work? Context: The binary search algorithm works by comparing the target value to the middle element of the array and narrows down the search range until the target is found or determined to be not in the array. Answer: [/INST]It compares the target value to the middle element of the array and continues narrowing down the search range until the target is found or determined to be not in the array.</s>