Skip to content

Commit c9a8dd3

Browse files
Merge pull request #16 from syedabdullahbukhari77/docs-d2
[-Linear Search / Algorithms]
2 parents 8a23fb0 + 1973f64 commit c9a8dd3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"nbformat":4,"nbformat_minor":0,"metadata":{"colab":{"provenance":[],"authorship_tag":"ABX9TyM9OAzthPDe/yMB8+QXqSdz"},"kernelspec":{"name":"python3","display_name":"Python 3"},"language_info":{"name":"python"}},"cells":[{"cell_type":"code","execution_count":14,"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"cqYl2wSJ_zo2","executionInfo":{"status":"ok","timestamp":1755786612361,"user_tz":-300,"elapsed":11,"user":{"displayName":"Syed Abdullah Bukhari (Imam)","userId":"18410448924632905759"}},"outputId":"4f880cc7-2f81-4e64-981a-3b6f3fbc8b2f"},"outputs":[{"output_type":"stream","name":"stdout","text":["Linear Search\n"]}],"source":["print('Linear Search')"]},{"cell_type":"code","source":["def linear_search(numbers: list , target: int) -> int:\n","\n"," for idx in range(len(numbers)):\n","\n"," if numbers[idx] == target: return idx\n","\n"," else: return -1\n"],"metadata":{"id":"cvQIaGZNAT2i","executionInfo":{"status":"ok","timestamp":1755786758797,"user_tz":-300,"elapsed":10,"user":{"displayName":"Syed Abdullah Bukhari (Imam)","userId":"18410448924632905759"}}},"execution_count":16,"outputs":[]},{"cell_type":"code","source":["print(linear_search([2 , 6 , 7 , 1 , 12] , 12))\n","print(linear_search([1 ,2 ,8 , 9 ,10] , 8))\n","print(linear_search([1 ,2 ,8 , 9 ,10] , 2))"],"metadata":{"colab":{"base_uri":"https://localhost:8080/"},"id":"1GW4tvggC7jo","executionInfo":{"status":"ok","timestamp":1755786906054,"user_tz":-300,"elapsed":15,"user":{"displayName":"Syed Abdullah Bukhari (Imam)","userId":"18410448924632905759"}},"outputId":"66a1f9ae-bbf5-4b4b-f142-835421e5d4e2"},"execution_count":21,"outputs":[{"output_type":"stream","name":"stdout","text":["4\n","2\n","1\n"]}]},{"cell_type":"code","source":[],"metadata":{"id":"g-cERQU-DErr","executionInfo":{"status":"ok","timestamp":1755786891452,"user_tz":-300,"elapsed":3,"user":{"displayName":"Syed Abdullah Bukhari (Imam)","userId":"18410448924632905759"}}},"execution_count":18,"outputs":[]},{"cell_type":"code","source":[],"metadata":{"id":"Pwy4wVzuDOFv"},"execution_count":null,"outputs":[]}]}

0 commit comments

Comments
 (0)