{"id":21156742,"url":"https://github.com/kimbo-slicee/java-data-structures","last_synced_at":"2025-06-14T04:07:56.515Z","repository":{"id":225692315,"uuid":"766603912","full_name":"kimbo-slicee/java-Data-Structures","owner":"kimbo-slicee","description":"Data Structures 📊📊 and Algorithms 📝 using Java ☕ 👨‍💻","archived":false,"fork":false,"pushed_at":"2024-04-17T22:24:45.000Z","size":4184,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-14T15:23:29.409Z","etag":null,"topics":["algorithms","arraylist","arrays","data-structures","java","multidimensional-arrays","multithreading","queue","stackbit","tree-structure"],"latest_commit_sha":null,"homepage":"","language":"Java","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/kimbo-slicee.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-03-03T18:04:44.000Z","updated_at":"2024-11-23T21:47:31.000Z","dependencies_parsed_at":"2024-04-17T23:27:02.732Z","dependency_job_id":"5480aa25-13ce-4324-b082-baab92976d9b","html_url":"https://github.com/kimbo-slicee/java-Data-Structures","commit_stats":null,"previous_names":["kimbo-slicee/data-structures"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kimbo-slicee/java-Data-Structures","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimbo-slicee%2Fjava-Data-Structures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimbo-slicee%2Fjava-Data-Structures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimbo-slicee%2Fjava-Data-Structures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimbo-slicee%2Fjava-Data-Structures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kimbo-slicee","download_url":"https://codeload.github.com/kimbo-slicee/java-Data-Structures/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kimbo-slicee%2Fjava-Data-Structures/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259756888,"owners_count":22906680,"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","arraylist","arrays","data-structures","java","multidimensional-arrays","multithreading","queue","stackbit","tree-structure"],"created_at":"2024-11-20T11:49:50.630Z","updated_at":"2025-06-14T04:07:56.459Z","avatar_url":"https://github.com/kimbo-slicee.png","language":"Java","readme":"# INTRODUCTION TO ➡  DATA STRUCTURES 📊\n![Static Badge](https://img.shields.io/badge/kimbo_Slicee-Data_Structures-chartreuse?style=plastic\u0026logo=github\u0026labelColor=indigo\u0026color=gold\u0026link=https%3A%2F%2Fgithub.com%2Fkimbo-slicee) ![Maven project](https://img.shields.io/badge/Maven_project-passing-chartreuse?style=flat\u0026logo=apachemaven)\n### What are Data Structures? 🤔\nA specialized format for organizing, processing, \nretrieving and storing data.\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"algorithms/src/main/resources/images/data-structure-gif.gif\" alt=\"Data\"\u003e\n\u003c/p\u003e\n\n### Why we need Data Structures\nAfter organizing data, it becomes easy to process it.\nIt is akin to searching for your clothing within an unorganized room, \na process that consumes considerable time and energy, ultimately leading to frustration. \nTherefore, it is advisable to organize your living space for a quick and efficient retrieval of items.\nAn important consideration is that this approach minimizes energy expenditure.\n\n### Type of Data Structures \n\n\n \u003cimg src=\"algorithms/src/main/resources/images/javaDataStructure.jpg\" alt=\"data-Structure\"\u003e Data Structures \n\n\n### Algorithms\n\nAn Algorithm is a set of instructions to perform a task or to solve a given problem, \nfor example\n\n### Analysis of Algorithms\nAnalysis of algorithm deals with finding the best algorithm which runs \nfast and takes in less memory  \n\n#### Time Complexity\nIt is the duration ⏱ taken by algorithm to run; the input processed by an \nalgorithm helps to determine the time complexity \\\nNote 📝: \u003cbr\u003e in java we can use the System.\nCurrentTimeMille function to know the different of time of execution between tow algorithems\nthat's just to simplify the time complexity,\nAnd there are specific mathematics tools to claclculate 🎰 the time complexity\n\n#### Space Complexity\nit is the amount of memory 💾 or space taken by algorithm to run \nthe memory required to process the input by an algorithm helps in determining the space complexity \n\n### Asymptotic Analysis of an Algorithm\n\u003e**Asymptotic analysis is a mathematical technique**\n\u003e\u003e*used for understanding the behavior of algorithms as their input increases. \nIt uses asymptotic notations to describe the growth rate or time complexity of an algorithm, \nwhich allows us to compare different algorithms and understand how they perform in realistic scenarios.*\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"algorithms/src/main/resources/images/bigOnatation.jpg\" alt=\"BigOnAnnotation\" width=\"600\" height=\"400\" \u003e\n\u003c/p\u003e\n\n\n### Asymptotic Notation \n- Asymptotic notations are mathematical tools to express the time complexity of algorithms for asymptotic analysis.\n- Asymptotic Notation is the mathematical tools used to describe the running time of an algorithm in terms of input size\n- Asymptotic Notation is used to describe the running time of an algorithm—how much time an algorithm takes with a given input, n.\n- Asymptotic Notations help us in determining:\n- 1️⃣.**Best Case** − Minimum time for the execution.🟢\n- 2️⃣.**Average Case** − Average time for the execution.🟠\n- 3️⃣.**Worst Case** − Maximum time for the execution.🔴\n**Note** 📝:\u003cbr\u003e if there’s no input to the algorithm, Then it is considered to work in a constant time.\nOther than the \"input\" all other factors are considered to be constant.\n\n### Type of Asymptotic Notation \nThere are three notations for performing runtime analysis of an algorithm\n- Big (O) Notation \n- Theta (Θ) Notation  \n- Omega (Ω) Notation\n#### Omega (Ω)  Notation \n![image description]( algorithms/src/main/resources/images/Omega-Asymptotic.png)\n- it is A Formal way to express the lower bound of an algorithm's running time \n- Lower bound means for any given input this notation determines the best amount of time an algorithm can take to complete\n- For example:\u003cbr\u003e if We say certain algorithm takes 100 secs as the best amount of time,\n  100 secs will be lower bound of that algorithm.\n  The algorithm can take more than 100 secs but will not take less than 100 secs \n#### Big O(O) Notation\n![image description]( algorithms/src/main/resources/images/bigONotationDiagramme.png)\nThe Asymptotic Notation Ο(n) represents the upper bound of an algorithm’s running time.\nIt measures or calculates the worst-case time complexity or the maximum or longest amount of time an algorithm can possibly take to complete.\nFor example, O(log n) represents a binary search algorithm’s upper bound.\n#### Rules of Big O(O) Notation 📍\n- it's a Single Processor \n- it performs Sequential Execution of statements \n- Assignment operation takes one unit of Time \n- Return statement takes in one unit of time \n- Arithmetical operation and Logical Operation takes one unit of Time\n- Other Small/single operations take one unit of time \n- Drop lower order terms: if n is huge we Drop lower order terms T=n²+3n+1====\u003eO(n²)\n- Drop constant multipliers T=3n²+6n+1 ====\u003e O(n²)\n#### Theta Asymptotic Notation, θ\n![image description]( algorithms/src/main/resources/images/Teta-AsymptoticNotation.png)\nThe Theta Asymptotic Notation Ο(n) represents the both lower bound and upper bound of an algorithm’s running time. \nIt measures the average case of time complexity. When we use big-Θ notation, \nwe’re saying that we have an asymptotically tight bound on the running time.\n#### Why are asymptotic notations important?\nAsymptotic notations provide a standardized way to compare and analyze algorithms’ efficiency,\nmaking it easier to assess their scalability and performance characteristics. \nThey help us focus on the core trends in algorithm behavior as input sizes become large, \nwhich is essential for designing robust and efficient software.\n### Calculating Time Complexity of Constant Algorithm \nIf an algorithm's time complexity is constant, it means that it will always run in the same amount of time;\nno matter the input size.For example, \nif we want to get the first item of an array,it doesn't matter how big the input size is.\n\u003cp align=\"left\"\u003e\n\u003cimg src=\"algorithms/src/main/resources/images/Capture.PNG\" alt=\"Time Complexity of a constant  Example\"\u003e\u003cbr\u003e\nin the First line we have four operations, so we have four Unite of Time \nand in the second line we have to operation, so it'd two unite of times  \nT=4+2=6 ==\u003e T=C(Constant)\n\u003c/p\u003e\nIn Complexity fo Constant Algorithm wherever the input size the Time complexity always still the O(1) \n  \n            ┌————————————————————————————————————————————┐ \n            │ Line number  | operations  | unite of Time │   \n            │------------- | ----------- | ------------- │ \n            │      2       |   1+1+1+1   |      4        │ \n            │ ------------ | ----------- | ------------- │\n            │      3       |     1+1     |      2        │  \n            │ ------------ | ----------- | ------------- │\n            └————————————————————————————————————————————┘\n            T=4+2=6\n            T~(Constant)\n            O(1)\n\n![Constant Time Complexity image ](algorithms/src/main/resources/images/ConstantTimeComplextiy.png)\n\n### Calculating time Complexity of Linear Algorithm\nAn algorithm is said to have a linear time complexity when the running time increases linearly with the length of the input.\nWhen the function involves checking all the values in input data, with this order O(n).\nThe above code shows that based on the length of the array (n), \nthe run time will get linearly increased.\u003cbr\u003e\n![img.png](algorithms/src/main/resources/images/img.png)\n\n     ┌————————————————————————————————————————————┐\n     │ Line number  | operations  | unite of Time │   \n     │------------- | ----------- | ------------- │\n     │      29      |      1      |      1        │\n     │ ------------ | ----------- | ------------- │\n     │      30      |  1+3n+3+3n  |     6n+4      │  \n     │ ------------ | ----------- | ------------- │\n     │      31      | n(1+1+1+1)  |      4n       │\n     │ ------------ | ----------- | ------------- │\n     │      33      |     1+1     |      2        │     \n     │ ------------ | ----------- | ------------- │\n     └————————————————————————————————————————————┘\n\n* \u003cp\u003e T=1+6n+4n+2 = 10n+7 in big O roles we have to ignore the constant 10 and lower Value 7 so O(n) \u003c/p\u003e \n\n![TimeComplexityOfLinear-diagram](algorithms/src/main/resources/images/TimeComplexityofLinear.png)\n\nNote 📝: \\\ntime is proportional with the input size\n\n### Calculating time Complexity of Polynomial Algorithm\nUnderstanding Polynomial Time Complexity: Polynomial-time complexity is denoted by the \"O(n^k)\" notation,\nwhere \"n\" represents the input size and \"k\" represents the degree of the polynomial.\nIn simpler terms, a polynomial time algorithm's runtime is directly proportional to some power of the input size \\\n![img](algorithms/src/main/resources/images/img.png)\n\n| Line number | operations  | unite of Time |\n| :---        |    :----:   |          ---: |\n| Header      | Title       | Here's this   |\n| Paragraph   | Text        | And more      |                \n                                                        \n                                                                 T=6n+4+6n²+4n+3n+n+1=9n²+11+5=O(n²)\n\n![Big O polynomial Alogorithem ](algorithms/src/main/resources/images/Big-O-Notation-Polynomial-Algorithm.png) \\\nNote 📝;\nthat's why we shouldn't 🚨 have to use nested loop a lot in our program\n\n# What is an Array? 🤔\nAn array is a collection of items of the same data type stored at contiguous memory locations, \nAnd the size of the array is immutable (Fixed) cannot be modified. \n![Array](algorithms/src/main/resources/images/array.png)\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimbo-slicee%2Fjava-data-structures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkimbo-slicee%2Fjava-data-structures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkimbo-slicee%2Fjava-data-structures/lists"}