{"id":21294584,"url":"https://github.com/al-ghaly/data-structure-functions","last_synced_at":"2025-03-15T17:12:35.786Z","repository":{"id":171120172,"uuid":"647353135","full_name":"al-ghaly/Data-Structure-Functions","owner":"al-ghaly","description":"Some basic Algorithms ","archived":false,"fork":false,"pushed_at":"2023-06-10T09:24:57.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T06:48:06.629Z","etag":null,"topics":["algorithms","data-structures","python","searching-algorithms","sorting-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/al-ghaly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-30T15:39:35.000Z","updated_at":"2023-05-30T21:27:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"77a0a7e8-e872-4914-94cc-712d6cb96466","html_url":"https://github.com/al-ghaly/Data-Structure-Functions","commit_stats":null,"previous_names":["al-ghaly/data-structure-functions-"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al-ghaly%2FData-Structure-Functions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al-ghaly%2FData-Structure-Functions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al-ghaly%2FData-Structure-Functions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/al-ghaly%2FData-Structure-Functions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/al-ghaly","download_url":"https://codeload.github.com/al-ghaly/Data-Structure-Functions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243762269,"owners_count":20343979,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","data-structures","python","searching-algorithms","sorting-algorithms"],"created_at":"2024-11-21T13:59:49.929Z","updated_at":"2025-03-15T17:12:35.780Z","avatar_url":"https://github.com/al-ghaly.png","language":"Python","readme":"# Data-Structure-Functions\n## Some basic Algorithms \n\u003cbr\u003e \u003cbr\u003e\n\n```python\n# function \"1\" to check if num is prime\ndef isprime(x):\n    #Implementation \n    \n# function \"2\" to get all factors of a num\ndef factors(n):\n\n# function \"3\" to get the square root for perfect square numbers\ndef sqrt(x):\n\n# function \"4\" to print first  n  prime nums\ndef ppns(n):\n  \n# function \"5\" to get square root of ana num by bisiction method\ndef square_root(x,n):\n \n# function \"6\" to get square root of any num by newten method\ndef Square_root(x,n):\n\n# function \"7\" a simple ex to solve 2 eq in 2 variables\ndef guessANDcheck(heads,legs):\n  \n# function \"8\"  to check if pallindrome or not\ndef isPalindrome(s):\n\n# function \"9\" calculate triangle hypotenuse\nimport math\ndef caculate():\n            \n# function \"10\" binary search increase by log2 of lists size\ndef search(v, k):\n \ndef search1(l,v):\n    # the same but with recursion\n    \n# function \"11\" examples on recursion\ndef factorial(a):\n  \ndef factorial2(a):\n\ndef mult(a,b):\n   \ndef towers(size,frome,to,spare):\n   \ndef pallindrome(s):\n    def tochars(s):\n       \n    def ispal(s):\n        \ndef rabbits(n):\n   \ndef rabbits2(n,d):\n    # very efficient and have a limit of 1000\n    # if we tried to put dic in local scope in every\n    # recursive step dic values will be ste to default\n    # and we will be redo the previous code with the same\n    # efficiency\n\ndef rabbits3(n):\n    # linear rabbits solution with 100000 limit\n    if n == 0 :\n    \ndef fib(n):\n  \ndef fib1(n):\n   \n# function \"12\"  sorting \u0026 searchind\ndef binary_search(list1, value):\n    \ndef linear_search(list1, value):\n\ndef sel_sort(list1):\n\ndef bubble_sort(list1):\n   \ndef insertion_sort(A):\n    \"\"\"\n    Sort list A into order, in place.\n    From Cormen/Leiserson/Rivest/Stein,\n    Introduction to Algorithms (second edition), page 17,\n    modified to adjust for fact that Python arrays use\n    0-indexing.\n    \"\"\"'\n    \ndef merging_sub_lists(left, right):\n \ndef merge(l1, l2):\n   \ndef merge_sort(list1):\n  \n##def merge_sort(list1):\n\n# function \"13\" to reverse list\ndef rev_list_(L):\n\n# function \"14\" to get the abs value\ndef abs(x):\n\n# function \"15\" an application on dynamic programming with knapsack problem \ndef max_value(w, v, i, aw, memo):\n    \"\"\"\n    its an application on dynamic programming its called knapsack problem in which we take items with values\n    and weights and a maximum allowed weight we want to get a maximum value under the weight constrain \n    we use dictionary as a memorization element to save previously calculated pairs of available weight and\n    level or index\n    \"\"\"\n    # we use global counter to get number of calls must be global not to be reset every call\n    \ndef max_value_test():\n  \ndef max_vaslue(w, v, vo, i, aw, av):\n\ndef max_vaslue_test():\n\n# function \"16\" to generate subsets of a set\ndef gen_subsets(n):\n\n# function \"17\" iterative fibonicci\ndef fib_iter(n):\n\n# function \"17\" Sort Method\ndef sort(l1, l):\n  # Implementation\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal-ghaly%2Fdata-structure-functions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fal-ghaly%2Fdata-structure-functions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fal-ghaly%2Fdata-structure-functions/lists"}