<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: Binary search algorithm divides a sorted array into two halves to find the search value. Answer: [/INST]It divides a sorted array into two halves and repeatedly compares the middle element of the search value.</s>