Skip to main content
Small markdown and spelling fixes
Source Link
Toby Speight
  • 81.7k
  • 14
  • 101
  • 308

My review is focused on linkedlist.c linkedlist.c:

  • Some functions don't check for NULLnull pointer (get_node_valget_node_val, set_node_valset_node_val). While it's documented, other functions do check for NULLnull pointer.
  • The functions to append and pretendprepend nodes require the caller to call the function to create a node. It might be a better idea to create the node in the function and to return the newly created-created node.
  • The function appendappend does not return the new node while the function prependprepend does.
  • The data can only be an integer,integer; having a void pointer on the listed data allows to have any type of data. However, this change would make your search function unusable.
  • Printing the data is a way of handling the data. It seems that this is the role of the caller.
  • You may want to consider having a function to return the length of the list.

My review is focused on linkedlist.c :

  • Some functions don't check for NULL pointer (get_node_val, set_node_val). While it's documented, other functions do check for NULL pointer.
  • The functions to append and pretend nodes require the caller to call the function to create a node. It might be a better idea to create the node in the function and to return the newly created node.
  • The function append does not return the new node while the function prepend does.
  • The data can only be an integer, having a void pointer on the listed data allows to have any type of data. However, this change would make your search function unusable.
  • Printing the data is a way of handling the data. It seems that this is the role of the caller.
  • You may want to consider having a function to return the length of the list.

My review is focused on linkedlist.c:

  • Some functions don't check for null pointer (get_node_val, set_node_val). While it's documented, other functions do check for null pointer.
  • The functions to append and prepend nodes require the caller to call the function to create a node. It might be a better idea to create the node in the function and to return the newly-created node.
  • The function append does not return the new node while the function prepend does.
  • The data can only be an integer; having a void pointer on the listed data allows to have any type of data. However, this change would make your search function unusable.
  • Printing the data is a way of handling the data. It seems that this is the role of the caller.
  • You may want to consider having a function to return the length of the list.
deleted 174 characters in body
Source Link

My review is focused on linkedlist.c :

  • Some functions don't check for NULL pointer (get_node_val, set_node_val). While it's documented, other functions do check for NULL pointer.
  • It is only possible to insert a Node at the beginning or at the end of the list. It is not possible to insert a node after or before another one.
  • The functions to append and pretend nodes require the caller to call the function to create a node. It might be a better idea to create the node in the function and to return the newly created node.
  • The function append does not return the new node while the function prepend does.
  • The data can only be an integer, having a void pointer on the listed data allows to have any type of data. However, this change would make your search function unusable.
  • Printing the data is a way of handling the data. It seems that this is the role of the caller.
  • You may want to consider having functionsa function to return the head/taillength of the list as well as its length.

My review is focused on linkedlist.c :

  • Some functions don't check for NULL pointer (get_node_val, set_node_val). While it's documented, other functions do check for NULL pointer.
  • It is only possible to insert a Node at the beginning or at the end of the list. It is not possible to insert a node after or before another one.
  • The functions to append and pretend nodes require the caller to call the function to create a node. It might be a better idea to create the node in the function and to return the newly created node.
  • The function append does not return the new node while the function prepend does.
  • The data can only be an integer, having a void pointer on the listed data allows to have any type of data. However, this change would make your search function unusable.
  • Printing the data is a way of handling the data. It seems that this is the role of the caller.
  • You may want to consider having functions to return the head/tail of the list as well as its length.

My review is focused on linkedlist.c :

  • Some functions don't check for NULL pointer (get_node_val, set_node_val). While it's documented, other functions do check for NULL pointer.
  • The functions to append and pretend nodes require the caller to call the function to create a node. It might be a better idea to create the node in the function and to return the newly created node.
  • The function append does not return the new node while the function prepend does.
  • The data can only be an integer, having a void pointer on the listed data allows to have any type of data. However, this change would make your search function unusable.
  • Printing the data is a way of handling the data. It seems that this is the role of the caller.
  • You may want to consider having a function to return the length of the list.
Source Link

My review is focused on linkedlist.c :

  • Some functions don't check for NULL pointer (get_node_val, set_node_val). While it's documented, other functions do check for NULL pointer.
  • It is only possible to insert a Node at the beginning or at the end of the list. It is not possible to insert a node after or before another one.
  • The functions to append and pretend nodes require the caller to call the function to create a node. It might be a better idea to create the node in the function and to return the newly created node.
  • The function append does not return the new node while the function prepend does.
  • The data can only be an integer, having a void pointer on the listed data allows to have any type of data. However, this change would make your search function unusable.
  • Printing the data is a way of handling the data. It seems that this is the role of the caller.
  • You may want to consider having functions to return the head/tail of the list as well as its length.