{"id":26578836,"url":"https://github.com/pprunty/doubly_linked_list","last_synced_at":"2025-03-23T05:17:14.877Z","repository":{"id":168300396,"uuid":"436710816","full_name":"pprunty/doubly_linked_list","owner":"pprunty","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-23T23:40:25.000Z","size":206,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-11-24T00:27:34.164Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/pprunty.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}},"created_at":"2021-12-09T17:53:18.000Z","updated_at":"2021-12-09T18:01:56.000Z","dependencies_parsed_at":"2023-11-24T00:27:02.810Z","dependency_job_id":"f0f8ef73-534b-40f2-b9f6-8d1a9f1a2412","html_url":"https://github.com/pprunty/doubly_linked_list","commit_stats":null,"previous_names":["pprunty/doubly_linked_list"],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprunty%2Fdoubly_linked_list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprunty%2Fdoubly_linked_list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprunty%2Fdoubly_linked_list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pprunty%2Fdoubly_linked_list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pprunty","download_url":"https://codeload.github.com/pprunty/doubly_linked_list/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245056898,"owners_count":20553856,"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":[],"created_at":"2025-03-23T05:17:14.294Z","updated_at":"2025-03-23T05:17:14.857Z","avatar_url":"https://github.com/pprunty.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"Part of a college assignment...\n\n# Doubly Linked List\n\nIn computer science, a doubly linked list is a linked data structure that consists of a set of sequentially linked\nrecords called nodes. Each node contains three fields: two link fields (references to the previous and to the next node\nin the sequence of nodes) and one data field. The beginning and ending nodes' previous and next links, respectively,\npoint to some kind of terminator, typically a sentinel node or null, to facilitate traversal of the list. If there is \nonly one sentinel node, then the list is circularly linked via the sentinel node. It can be conceptualized as two singly\nlinked lists formed from the same data items, but in opposite sequential orders.\n\n![](doubly-linked-list.gif)\n\n## Contents\n\n1. [Overview](#overview)\n2. [Requirements](#requirements)\n3. [Compilation and Usage](#compilation-and-usage)\n4. [Known Issues](#known-issues)\n\n## Overview\n\nA simple program that creates and manipulates Linked Lists. This program will accept command line arguments.\nThe program will read data from a file and use that data to create and populate a linked list. It will then\nfilter the list by removing nodes from the list depending on the size of the data in the node, and parameters\nwhich you pass in.\n\nFor the purpose of this assignment, the data is simply a txt file containing the dimension and values for an n x n \nmatrix where each matrix represents a node in the linked list:\n\n```text\n7\t7.3\t6.0\t5.5\t0.0\t4.2\t7.8\t0.6\t7.6\t6.9\t6.3\t5.5\t8.4\t3.7\t0.6\t9.0\t8.9\t0.3\t4.5\t8.8\t2.1\t6.4\t1.4\t0.4\t3.1\t3.1\t6.9\t3.4\t2.6\t0.4\t9.7\t9.8\t1.6\t3.9\t5.8\t6.8\t1.2\t1.4\t5.2\t7.0\t1.4\t4.9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t4.1\t6.3\t6.9\n5\t6.2\t4.7\t2.3\t5.9\t3.5\t0.6\t3.8\t5.0\t5.7\t7.3\t1.3\t2.0\t7.2\t6.6\t0.9\t0.5\t2.8\t0.3\t5.4\t5.0\t7.9\t2.2\t9.5\t6.8\t9.4\n7\t6.8\t8.2\t7.5\t4.5\t3.1\t4.3\t1.4\t1.8\t7.6\t5.2\t4.9\t4.3\t8.2\t9.1\t3.6\t4.4\t5.7\t9.0\t5.8\t4.5\t9.0\t2.2\t3.9\t6.1\t0.5\t1.1\t0.4\t7.3\t7.9\t3.0\t7.0\t1.2\t1.2\t4.0\t8.8\t8.8\t1.9\t8.1\t8.8\t9.4\t2.4\t8.2\t1.4\t1.1\t7.3\t2.8\t6.8\t1.4\t6.5\n1\t1.6\n```\n\nHowever, Linked Lists can be used for other more complicated data structures; most notably a web browser cache which \nallows BACK-FORWARD pages, a music player which has next and prev buttons and any application which has a undo-redo \nfunctionality.\n\nThis program is particularly useful for those who wish to get accustomed to using pointers.\n\n## Requirements\n\n- gcc\n\n## Compilation and Usage\n\nTo compile the code simply run the following command inside a terminal in the project directory:\n\n```shell\nmake\n```\n\nThe program has the following usage and default parameters:\n\n```shell\nUsage: ./main [-i \u003cfilename\u003e] [-n \u003cmin_size\u003e] [-x \u003cmax_size\u003e] [-h (prints usage)]\nDefault: ./main [-i data.txt] [-n 0] [-x 1000] [-h]\n```\n\nTherefore, if you wish to run the program using the default parameters, simply run:\n\n```shell\n./main\n```\n\nOr alternatively, if you wish to filter the data in the linked list to remove all square matrices that are\nbigger than 4 x 4, you may run the following command using command line arguments:\n\n```shell\n./main -i data.txt -n 0 -x 4\n```\n\nTo clean up executables, run the following command:\n\n```shell\nmake clean\n```\n\n## Results\n\nRunning the program with the default parameters:\n\n```shell\n./main\n```\n\nwe get this output:\n\n```shell\n---------\nOriginal Data\n---------\n7.30    6.00    5.50    0.00    4.20    7.80    0.60\n7.60    6.90    6.30    5.50    8.40    3.70    0.60\n9.00    8.90    0.30    4.50    8.80    2.10    6.40\n1.40    0.40    3.10    3.10    6.90    3.40    2.60\n0.40    9.70    9.80    1.60    3.90    5.80    6.80\n1.20    1.40    5.20    7.00    1.40    4.90    3.40\n5.70    2.30    5.30    9.30    5.80    2.40    3.90\n\n6.20    8.00\n9.20    9.30\n\n6.10    6.00    1.80    5.80    6.40    7.10    6.80    4.80    7.30\n4.70    2.60    2.70    7.40    1.30    5.80    1.80    4.30    6.10\n8.60    2.20    9.30    8.50    3.30    9.50    1.00    0.00    2.00\n6.00    7.60    0.40    6.50    2.50    6.80    0.50    6.10    5.40\n8.90    1.30    5.60    4.90    6.90    3.00    0.50    5.00    5.30\n2.30    5.80    0.20    6.70    3.20    5.30    0.10    5.00    1.10\n6.30    9.70    6.60    6.50    4.80    8.60    8.00    6.00    5.60\n0.20    4.90    8.10    5.80    0.90    2.10    0.80    8.10    4.20\n6.30    7.80    1.00    5.10    4.00    2.40    2.10    5.40    3.30\n\n8.70\n\n8.60    3.00    7.40    5.40    5.10\n5.40    7.20    2.50    6.00    4.50\n8.80    5.10    7.90    8.80    4.70\n7.10    9.60    5.40    6.20    5.00\n4.40    5.00    8.30    4.20    6.20\n\n8.10    7.00\n8.10    3.70\n\n8.40    0.50    5.20    5.30    9.10    1.50    8.40    7.80    0.70\n1.20    9.60    3.00    2.50    0.10    2.20    1.80    7.40    5.00\n0.20    9.60    6.30    0.00    7.90    3.10    5.90    0.50    7.10\n4.90    6.20    3.80    6.60    8.40    6.10    7.40    9.00    5.80\n1.30    5.10    3.30    4.60    1.70    3.10    4.30    4.00    2.50\n8.20    1.30    4.90    1.80    9.80    2.30    8.20    4.70    1.90\n1.10    9.70    7.60    8.90    5.90    4.30    6.60    9.30    3.20\n7.60    8.10    8.70    1.90    5.90    9.30    9.80    6.50    7.60\n1.30    5.90    1.90    3.70    8.50    8.20    4.10    6.30    6.90\n\n6.20    4.70    2.30    5.90    3.50\n0.60    3.80    5.00    5.70    7.30\n1.30    2.00    7.20    6.60    0.90\n0.50    2.80    0.30    5.40    5.00\n7.90    2.20    9.50    6.80    9.40\n\n6.80    8.20    7.50    4.50    3.10    4.30    1.40\n1.80    7.60    5.20    4.90    4.30    8.20    9.10\n3.60    4.40    5.70    9.00    5.80    4.50    9.00\n2.20    3.90    6.10    0.50    1.10    0.40    7.30\n7.90    3.00    7.00    1.20    1.20    4.00    8.80\n8.80    1.90    8.10    8.80    9.40    2.40    8.20\n1.40    1.10    7.30    2.80    6.80    1.40    6.50\n\n\n---------\nAfter Filtering\n---------\n7.30    6.00    5.50    0.00    4.20    7.80    0.60\n7.60    6.90    6.30    5.50    8.40    3.70    0.60\n9.00    8.90    0.30    4.50    8.80    2.10    6.40\n1.40    0.40    3.10    3.10    6.90    3.40    2.60\n0.40    9.70    9.80    1.60    3.90    5.80    6.80\n1.20    1.40    5.20    7.00    1.40    4.90    3.40\n5.70    2.30    5.30    9.30    5.80    2.40    3.90\n\n6.20    8.00\n9.20    9.30\n\n6.10    6.00    1.80    5.80    6.40    7.10    6.80    4.80    7.30\n4.70    2.60    2.70    7.40    1.30    5.80    1.80    4.30    6.10\n8.60    2.20    9.30    8.50    3.30    9.50    1.00    0.00    2.00\n6.00    7.60    0.40    6.50    2.50    6.80    0.50    6.10    5.40\n8.90    1.30    5.60    4.90    6.90    3.00    0.50    5.00    5.30\n2.30    5.80    0.20    6.70    3.20    5.30    0.10    5.00    1.10\n6.30    9.70    6.60    6.50    4.80    8.60    8.00    6.00    5.60\n0.20    4.90    8.10    5.80    0.90    2.10    0.80    8.10    4.20\n6.30    7.80    1.00    5.10    4.00    2.40    2.10    5.40    3.30\n\n8.70\n\n8.60    3.00    7.40    5.40    5.10\n5.40    7.20    2.50    6.00    4.50\n8.80    5.10    7.90    8.80    4.70\n7.10    9.60    5.40    6.20    5.00\n4.40    5.00    8.30    4.20    6.20\n\n8.10    7.00\n8.10    3.70\n\n8.40    0.50    5.20    5.30    9.10    1.50    8.40    7.80    0.70\n1.20    9.60    3.00    2.50    0.10    2.20    1.80    7.40    5.00\n0.20    9.60    6.30    0.00    7.90    3.10    5.90    0.50    7.10\n4.90    6.20    3.80    6.60    8.40    6.10    7.40    9.00    5.80\n1.30    5.10    3.30    4.60    1.70    3.10    4.30    4.00    2.50\n8.20    1.30    4.90    1.80    9.80    2.30    8.20    4.70    1.90\n1.10    9.70    7.60    8.90    5.90    4.30    6.60    9.30    3.20\n7.60    8.10    8.70    1.90    5.90    9.30    9.80    6.50    7.60\n1.30    5.90    1.90    3.70    8.50    8.20    4.10    6.30    6.90\n\n6.20    4.70    2.30    5.90    3.50\n0.60    3.80    5.00    5.70    7.30\n1.30    2.00    7.20    6.60    0.90\n0.50    2.80    0.30    5.40    5.00\n7.90    2.20    9.50    6.80    9.40\n\n6.80    8.20    7.50    4.50    3.10    4.30    1.40\n1.80    7.60    5.20    4.90    4.30    8.20    9.10\n3.60    4.40    5.70    9.00    5.80    4.50    9.00\n2.20    3.90    6.10    0.50    1.10    0.40    7.30\n7.90    3.00    7.00    1.20    1.20    4.00    8.80\n8.80    1.90    8.10    8.80    9.40    2.40    8.20\n1.40    1.10    7.30    2.80    6.80    1.40    6.50\n\n\n```\n\nHowever, we can filter the data in the linked list to remove any square matrices in the linked list that are bigger than\n4 x 4:\n\n```shell\n./main -i data.txt -n 0 -x 4\n```\n\nOur output is:\n\n```shell\n\n---------\nOriginal Data\n---------\n7.30    6.00    5.50    0.00    4.20    7.80    0.60\n7.60    6.90    6.30    5.50    8.40    3.70    0.60\n9.00    8.90    0.30    4.50    8.80    2.10    6.40\n1.40    0.40    3.10    3.10    6.90    3.40    2.60\n0.40    9.70    9.80    1.60    3.90    5.80    6.80\n1.20    1.40    5.20    7.00    1.40    4.90    3.40\n5.70    2.30    5.30    9.30    5.80    2.40    3.90\n\n6.20    8.00\n9.20    9.30\n\n6.10    6.00    1.80    5.80    6.40    7.10    6.80    4.80    7.30\n4.70    2.60    2.70    7.40    1.30    5.80    1.80    4.30    6.10\n8.60    2.20    9.30    8.50    3.30    9.50    1.00    0.00    2.00\n6.00    7.60    0.40    6.50    2.50    6.80    0.50    6.10    5.40\n8.90    1.30    5.60    4.90    6.90    3.00    0.50    5.00    5.30\n2.30    5.80    0.20    6.70    3.20    5.30    0.10    5.00    1.10\n6.30    9.70    6.60    6.50    4.80    8.60    8.00    6.00    5.60\n0.20    4.90    8.10    5.80    0.90    2.10    0.80    8.10    4.20\n6.30    7.80    1.00    5.10    4.00    2.40    2.10    5.40    3.30\n\n8.70\n\n8.60    3.00    7.40    5.40    5.10\n5.40    7.20    2.50    6.00    4.50\n8.80    5.10    7.90    8.80    4.70\n7.10    9.60    5.40    6.20    5.00\n4.40    5.00    8.30    4.20    6.20\n\n8.10    7.00\n8.10    3.70\n\n8.40    0.50    5.20    5.30    9.10    1.50    8.40    7.80    0.70\n1.20    9.60    3.00    2.50    0.10    2.20    1.80    7.40    5.00\n0.20    9.60    6.30    0.00    7.90    3.10    5.90    0.50    7.10\n4.90    6.20    3.80    6.60    8.40    6.10    7.40    9.00    5.80\n1.30    5.10    3.30    4.60    1.70    3.10    4.30    4.00    2.50\n8.20    1.30    4.90    1.80    9.80    2.30    8.20    4.70    1.90\n1.10    9.70    7.60    8.90    5.90    4.30    6.60    9.30    3.20\n7.60    8.10    8.70    1.90    5.90    9.30    9.80    6.50    7.60\n1.30    5.90    1.90    3.70    8.50    8.20    4.10    6.30    6.90\n\n6.20    4.70    2.30    5.90    3.50\n0.60    3.80    5.00    5.70    7.30\n1.30    2.00    7.20    6.60    0.90\n0.50    2.80    0.30    5.40    5.00\n7.90    2.20    9.50    6.80    9.40\n\n6.80    8.20    7.50    4.50    3.10    4.30    1.40\n1.80    7.60    5.20    4.90    4.30    8.20    9.10\n3.60    4.40    5.70    9.00    5.80    4.50    9.00\n2.20    3.90    6.10    0.50    1.10    0.40    7.30\n7.90    3.00    7.00    1.20    1.20    4.00    8.80\n8.80    1.90    8.10    8.80    9.40    2.40    8.20\n1.40    1.10    7.30    2.80    6.80    1.40    6.50\n\n\n---------\nAfter Filtering\n---------\n6.20    8.00\n9.20    9.30\n\n8.70\n\n8.10    7.00\n8.10    3.70\n\n```\n\n## Known Issues\n\nNone at present.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpprunty%2Fdoubly_linked_list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpprunty%2Fdoubly_linked_list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpprunty%2Fdoubly_linked_list/lists"}