{"id":16648979,"url":"https://github.com/rohan-bhautoo/data-structures-and-algorithms","last_synced_at":"2026-05-26T14:42:52.032Z","repository":{"id":223939354,"uuid":"761872354","full_name":"rohan-bhautoo/Data-Structures-and-Algorithms","owner":"rohan-bhautoo","description":"Data Structures is about how data can be stored in different structures. Algorithms is about how to solve different problems, often by searching through and manipulating data structures. Theory about Data Structures and Algorithms (DSA) helps us to use large amounts of data to solve problems efficiently.","archived":false,"fork":false,"pushed_at":"2024-03-13T19:04:32.000Z","size":130,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-27T00:45:26.550Z","etag":null,"topics":["algorithm-analysis","algorithm-challenges","algorithms","csharp","data-structures","data-structures-and-algorithms"],"latest_commit_sha":null,"homepage":"https://www.programiz.com/csharp-programming/online-compiler/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rohan-bhautoo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-02-22T16:39:38.000Z","updated_at":"2024-03-12T06:59:23.000Z","dependencies_parsed_at":"2024-12-12T17:30:07.152Z","dependency_job_id":null,"html_url":"https://github.com/rohan-bhautoo/Data-Structures-and-Algorithms","commit_stats":null,"previous_names":["rohan-bhautoo/algorithms","rohan-bhautoo/data-structures-and-algorithms"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rohan-bhautoo/Data-Structures-and-Algorithms","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohan-bhautoo%2FData-Structures-and-Algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohan-bhautoo%2FData-Structures-and-Algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohan-bhautoo%2FData-Structures-and-Algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohan-bhautoo%2FData-Structures-and-Algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rohan-bhautoo","download_url":"https://codeload.github.com/rohan-bhautoo/Data-Structures-and-Algorithms/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohan-bhautoo%2FData-Structures-and-Algorithms/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33525941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T03:12:49.672Z","status":"ssl_error","status_checked_at":"2026-05-26T03:12:47.976Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["algorithm-analysis","algorithm-challenges","algorithms","csharp","data-structures","data-structures-and-algorithms"],"created_at":"2024-10-12T09:06:13.455Z","updated_at":"2026-05-26T14:42:52.002Z","avatar_url":"https://github.com/rohan-bhautoo.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Data Structures and Algorithms\nData Structures is about how data can be stored in different structures. Algorithms is about how to solve different problems, often by searching through and manipulating data structures. Theory about Data Structures and Algorithms (DSA) helps us to use large amounts of data to solve problems efficiently.\n\n## The Big O Notation\nBig O notation is a mathematical notation that describes the limiting behavior of a function when the argument tends towards a particular value or infinity.\n\n\u003e [!TIP]\n\u003e Big O is used to describe the performance of an algorithm.\n\n![1 FkQzWqqIMlAHZ_xNrEPKeA](https://github.com/rohan-bhautoo/Algorithms/assets/47154593/5ac2c1a4-1038-48df-9877-f7fc7c7e7592)\n\n### $O(1)$\nThe code below prints the first item of the array. The size of the array doesn't matter. The operation takes a constant amount to run.\n```c#\npublic void log(int[] numbers)\n{\n  Console.WriteLine(numbers[0])\n}\n```\n\n### $O(N)$\nThe code below iterates over the array and prints each item in the console. The size of the input matters. The cost of this algorithm grows linearly and in direct correlation to the size of the input ($N$).\n```c#\npublic void log(int[] numbers)\n{\n  for(int i = 0; i \u003c numbers.Length; i++)\n  {\n    Console.WriteLine(numbers[i]);\n  }\n}\n```\n\n### $O(N^2)$\nThe code below contains a nested loop. The array is iterated twice. This algorithm runs in quadratic time, therefore as the input size grows, the algorithm runs slower.\n```c#\npublic void log(int[] numbers)\n{\n  for(int i = 0; i \u003c numbers.Length; i++)\n  {\n    for(int j = 0; j \u003c numbers.Length; j++)\n    {\n      Console.WriteLine(numbers[j]);\n    }\n  }\n}\n```\n\n### $O(log N)$\nAn algorithm that runs at logarithmic time ($O(log N)$) is more efficient and scalable than linear ($O(N)$) or ($O(N^2)$) algorithms.\n\nFor example, a linear search needs to iterate over each item of the array. In the worst case scenario, the item is at the last position of the array. However, binary search algorithm is much faster as it starts by looking at the middle item if it is greater or smaller than the searched value. This means that the array is narrowed down by half.\n\n### $O(2^N)$\nAlgorithms with exponential time, $O(2^N)$, are not scalable as the input size grows faster. Exponential growth is the opposite of logarithmic growth.\n\n### Space Complexity\nSpace complexity refers to the total amount of memory space used by an algorithm, including the space of input values for execution.\n\nIn the code below, the for loop is independent of the size of the input. Even if the input array has 10 or 1,000,000 items, the method will only allocate some memory for the loop variable. The space complexity is $O(1)$.\n\n```c#\npublic void greet(String[] names)\n{\n  for(int i = 0; i \u003c names.Length; i++)\n  {\n    Console.WriteLine(\"Hi \" + names[i]);\n  }\n}\n```\n\nIn the code below, the first and second string array will be of the same size. The more item in the input array, the more space the method will take. The space complexity is $O(N)$.\n\n```c#\npublic void greet(String[] names)\n{\n  String[] copy = new String[names.Length];\n\n  for(int i = 0; i \u003c names.Length; i++)\n  {\n    Console.WriteLine(\"Hi \" + names[i]);\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohan-bhautoo%2Fdata-structures-and-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohan-bhautoo%2Fdata-structures-and-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohan-bhautoo%2Fdata-structures-and-algorithms/lists"}