{"id":23012316,"url":"https://github.com/lmizner/tideman_election","last_synced_at":"2025-04-02T17:12:29.561Z","repository":{"id":140410119,"uuid":"350899335","full_name":"lmizner/tideman_election","owner":"lmizner","description":"A program that runs a Tideman election, which is a ranked-choice voting method to produces the candidate that wins the majority of the vote in every head-to-head match up. ","archived":false,"fork":false,"pushed_at":"2021-03-30T21:33:07.000Z","size":32,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-08T07:41:39.272Z","etag":null,"topics":["algorithms","bubble-sort","c","conditional-statements","loops","nested-loops"],"latest_commit_sha":null,"homepage":"","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/lmizner.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":"2021-03-24T00:38:53.000Z","updated_at":"2024-10-29T00:41:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"9836db09-560a-42d3-9fec-7b97da07b255","html_url":"https://github.com/lmizner/tideman_election","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmizner%2Ftideman_election","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmizner%2Ftideman_election/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmizner%2Ftideman_election/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lmizner%2Ftideman_election/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lmizner","download_url":"https://codeload.github.com/lmizner/tideman_election/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246856677,"owners_count":20844974,"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","bubble-sort","c","conditional-statements","loops","nested-loops"],"created_at":"2024-12-15T10:13:30.830Z","updated_at":"2025-04-02T17:12:29.538Z","avatar_url":"https://github.com/lmizner.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tideman_election\n\nCS50 Problem Set: https://cs50.harvard.edu/x/2021/psets/3/tideman/\n\nThis problem set required the implementation of 6 functions (vote, record_preferences, add_pairs, sort_pairs, lock_pairs, print_winner) in the tideman.c file. \n\nVote:\nThe vote function takes the name of the candidate, rank of the candidate, and ranks array as input. A for loop cycles through all of the candidates, checking that \nthe candidate name input by the user is a valid candidate in the election. If valid, then the candidates rank will be recorded in the ranks array and the function \nwill return true. Otherwise, the function will return false. \n\nRecord_Preferences:\nThe record_preferences function takes the ranks array as input for each voter. The function loops through each voter, updating the global preferences array with \neach voter's preferences. The preferences array is equal to the number of voters that prefer candidate i over candidate j. \n\nAdd_Pairs:\nThe add_pairs function will add all pairs of candidates where one candidate is preferred and update the global variable pair_count with the number of candidate \npairs. If the candidates are tied, they will not be added to the array.\n\nSort_Pairs:\nThe sort_pairs function sorts the pairs of candidates is decreasing order by strength of victory through the use of the bubble sort method. \n\nLock_Pairs:\nThe lock_pairs function will create the locked in order of candidate rankings as long as the locked in pairs don't create a cycle with the winners, meaning there \nwould be no way to pick a winner. \n\nPrint_Winner:\nThe print_winner function will print out the name of the candidate the wins the tideman election as the \"source\" meaning that no other candidate beats them in a \nhead to head matchup. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmizner%2Ftideman_election","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flmizner%2Ftideman_election","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flmizner%2Ftideman_election/lists"}