Add CMakeLists for all datastructs
+ Reorder, refactor comments
This commit is contained in:
18
cpp/datastructs/circledoublelist/CMakeLists.txt
Normal file
18
cpp/datastructs/circledoublelist/CMakeLists.txt
Normal file
@@ -0,0 +1,18 @@
|
||||
###############################################################################
|
||||
## Author: Shaun Reed ##
|
||||
## Legal: All Content (c) 2020 Shaun Reed, all rights reserved ##
|
||||
## About: An example of a circular doubly linked list implementation ##
|
||||
## ##
|
||||
## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com | GitHub: shaunrd0 ##
|
||||
##############################################################################
|
||||
## CMakeLists.txt
|
||||
#
|
||||
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.2)
|
||||
|
||||
# Define the project name
|
||||
project(CircleDouble)
|
||||
# Define source files
|
||||
set(SRC driver.cpp circledoublelist.cpp)
|
||||
# Build an executable
|
||||
add_executable(CircleDoubleDriver ${SRC})
|
||||
@@ -247,7 +247,7 @@ bool CircleDoubleList::insert(int val, Node *&tail)
|
||||
// Relink the current head to the node after newNode
|
||||
newNode->next = tail->next;
|
||||
tail->next->prev = newNode;
|
||||
// Relink our head and tail nodes, makine newNode the head node
|
||||
// Relink our head and tail nodes, making newNode the head node
|
||||
tail->next = newNode;
|
||||
newNode->prev = tail;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user