-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added documentation and README file to linked list folder, minor fixes to README #456
base: master
Are you sure you want to change the base?
Changes from all commits
732e4cd
67b91fd
de8c691
40caf8b
22e20ac
a24e5ee
8c56231
bfad1d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be deleted |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is out of scope for this PR. If you like you can create a new PR to suggest adding this GitHub action. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: SonarCloud | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
jobs: | ||
build: | ||
name: Build and analyze | ||
runs-on: macos-latest | ||
env: | ||
BUILD_WRAPPER_OUT_DIR: build_wrapper_output_directory # Directory where build-wrapper output will be placed | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis | ||
- name: Install sonar-scanner and build-wrapper | ||
uses: SonarSource/sonarcloud-github-c-cpp@v2 | ||
- name: Run build-wrapper | ||
run: | | ||
build-wrapper-macosx-x86 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} xcodebuild | ||
- name: Run sonar-scanner | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
run: | | ||
sonar-scanner --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Linked List | ||
|
||
The linked list is a dynamic data structure that contains elements not stored in contiguous memory. This means that the elements of the list must contain pointers to other elements in the list in order to form a chain of associations. | ||
As a result of it being dynamic, the linked list can easily grow and shrink. | ||
Common implementations of the linked list include stacks and queues, which often only need to access or remove elements from the front or end of a list. | ||
|
||
### Contents | ||
|
||
1. [doubly linked list](#1-doubly-linked-list) | ||
2. [singly linked list](#2-singly-linked-list) | ||
|
||
--- | ||
|
||
## 1. Doubly Linked List | ||
|
||
The Doubly Linked List stores a list of elements that contain pointers to both the previous and next element in the list. | ||
This implementation of the linked list allows for both forward and backward traversion, but it does require more memory than the Singly Linked List. | ||
|
||
|
||
### Complexity | ||
|
||
Time | Space | ||
--------|------------------- | ||
_O(N)_ | _O(1)_ | ||
|
||
where N is the number of elements. | ||
|
||
## 2. Singly Linked List | ||
|
||
The Singly Linked List stores a list of elements that contain a pointer to the next element in the list. | ||
This implementation of the linked list allows for only forward traversion, but requires less memory than the Doubly Linked List. | ||
|
||
|
||
### Complexity | ||
|
||
Time | Space | ||
--------|------------------- | ||
_O(N)_ | _O(N)_ | ||
|
||
where N is the number of elements. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -178,6 +178,7 @@ SinglyLinkedList<T>::SinglyLinkedList() { | |
/* | ||
Destructor | ||
---------- | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This blank link can be removed. |
||
*/ | ||
|
||
template<class T> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be deleted. You can update
.gitignore
to add an entry for.DS_Store