{"id":19982681,"url":"https://github.com/nikhil-jindal12/sortingalgorithms","last_synced_at":"2025-03-01T20:13:12.817Z","repository":{"id":208917991,"uuid":"722774272","full_name":"nikhil-jindal12/SortingAlgorithms","owner":"nikhil-jindal12","description":"Contains implementation for a unique form of Case Western Reserve University's campus cash and customized merge sort and quick sort methods.","archived":false,"fork":false,"pushed_at":"2023-12-22T01:17:17.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T10:48:29.835Z","etag":null,"topics":["java-8","javadoc-documentation","merge-sort","quick-sort"],"latest_commit_sha":null,"homepage":"https://nikhil-jindal12.github.io/SortingAlgorithms/","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/nikhil-jindal12.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":"2023-11-23T23:23:14.000Z","updated_at":"2023-12-22T01:21:01.000Z","dependencies_parsed_at":"2023-11-24T01:33:19.051Z","dependency_job_id":"822be5e1-5822-483c-b84c-68119526049d","html_url":"https://github.com/nikhil-jindal12/SortingAlgorithms","commit_stats":null,"previous_names":["nikhil-jindal12/sortingalgorithms"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhil-jindal12%2FSortingAlgorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhil-jindal12%2FSortingAlgorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhil-jindal12%2FSortingAlgorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nikhil-jindal12%2FSortingAlgorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nikhil-jindal12","download_url":"https://codeload.github.com/nikhil-jindal12/SortingAlgorithms/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241418356,"owners_count":19959736,"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":["java-8","javadoc-documentation","merge-sort","quick-sort"],"created_at":"2024-11-13T04:12:33.374Z","updated_at":"2025-03-01T20:13:12.800Z","avatar_url":"https://github.com/nikhil-jindal12.png","language":"Java","readme":"# SortingAlgorithms\n\nThis repository contains three classes: `Student.java`, `CaseCashSystem.java`, and `CaseCashSystemTest.java`. These files build off of Case Western Reserve University's campus cash which is called CaseCash. \n\nThe point of this repository is to implement the following functionalities with the CaseCash plan:\n- Transfer of CaseCash from Student A to Student B\n- Deposit CaseCash into a Student account\n- Withdraw CaseCash\n- View student account balance\n- Be able to sort students by name and account balance (using different sorting algorithms)\n\n----\n\nThe `Student.java` class has the following functionalities:\n- `int getBalance()` - returns the CaseCash balance the student has in their account\n- `void updateBalance(int newAmount)` - updates the CaseCash balance the student has in their account\n\n----\n\nThe `CaseCashSystem.java` class has the following functionalities:\n- `List\u003cString\u003e runSimulation(List\u003cString\u003e commands)` - this parses the commands it is given, calls the respective helper functions, and runs a simulation provided based on the commands it is given (more details regarding the inputs are given below)\n- `boolean init(String name, int initialBalance)` - initializes a student with the name and initial CaseCash balance given, returning false if the initial balance is negative or a student with the same name already exists\n- `int getBalance(String name)` - returns the balance of a student given their name\n- `boolean deposit(Student student, int amount)` - deposits CaseCash to a student's account, returning false if the deposit fails\n- `boolean transfer(Student studentA, Student studentB, int amount)` - transfers the amount of CaseCash from studentA to studentB's account, returning false if the transfer was unsuccessful or the amount was negative\n- `List\u003cString\u003e sortName()` - returns a list of student's names in alphabetical order using a customized implementation of **merge sort**\n- `List\u003cString\u003e sortBalance()` - returns a list of student's name in the order of smallest balance to largest balance in their account using a customized implementation of **quick sort**\n- `boolean withdrawal(Student student, int amount)` - removes CaseCash from a student's account, returning false if the transaction will result in a negative balance\n\n----\n\n### Inputs\n\nInputs are given to the simulation in the following format:\n- “**INIT**, name, initialBalance”\n- “**GET**, name”\n- “**TRANSFER**, studentA, studentB, amount”\n- “**WITHDRAWAL**, studentA, amount”\n- “**DEPOSIT**, studentA, amount”\n- “**SORT**, name or balance”\n\nEach of the bolded keywords corresponds directly to one of the methods in the `CaseCashSystem.java` class. \n\nHere is an example simulation:\n\n    List\u003cString\u003e inputs = [“INIT, Tammy, 200”,\n                            “INIT, Kim, 300”,\n                            “INIT, Quyen, 400”,\n                            “SORT, name”,\n                            “SORT, balance”,\n                            “TRANSFER, Kim, Tammy, 100”,\n                            “SORT, name”,\n                            “SORT, balance”];\n\n    System.out.println(runSimulation(List\u003cString\u003e inputs))\n    \u003e\u003e\u003e [“true”,\n        “true”,\n        “true”,\n        “[Kim, Quyen, Tammy]”,\n        “[Tammy, Kim, Quyen]”,\n        “true”,\n        “[Kim, Quyen, Tammy]”,\n        “[Kim, Tammy, Quyen]”]\n\n----\n\n### JUnit Testing\n\nThe `CaseCashSystemTest.java` class contains thorough JUnit testing for each of the methods in the `CaseCashSystem.java` class. All of the JUnit tests pass, and therefore the customized implementations of **merge sort** and **quick sort** correctly sort the student's names and balances.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhil-jindal12%2Fsortingalgorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnikhil-jindal12%2Fsortingalgorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnikhil-jindal12%2Fsortingalgorithms/lists"}