Skip to content

APIs for linked list module. #463

Open
@ChetanKarwa

Description

@ChetanKarwa

Description

I am currently working on the Linked List module for stdlib (under GSoC 2021).
This issue is somewhat an extension to an already existing issue #68.
This especially focuses on APIs for Linked List. This thread is to welcome ideas for APIs that can be implemented in the module and ideas for optimum implementation of the same.

For my project, I have implemented 3 types of lists:

  • A simple linked list
  • A list of list
  • A list of arrays

Based on some tests with random data set, we decided that out of all the 3 implementations "list of list" is better compared to the other 2.
So for the time being, I intend to implement all the APIs on the "list of list" model.

APIs that I intend to implement

  • insert: Insert an element at the specified index of the list
  • set/replace: Replaces an element at the given index
  • clear: Deletes the whole list (Without memory leaks)
  • Size: Returns the size of the list
  • reverse: Reverse the list
  • sort: Sort the items in the list (if homogenous, not sure)
  • Concat: Appends a list to another list
  • slice: Returns a Slice (a continuous part) of the list
  • splice: Removes a continuous part of the list

Already Implemented

  • Get: Returns the element stored at index.
  • pop: Removes an element from the end of the list.
  • remove: Removes an element present at given index
  • append: Append an element at the end of the list

My works (link).

Metadata

Metadata

Assignees

No one assigned

    Labels

    APIDiscussion on a specific API for a proposal (exploratory)topic: container(Abstract) data structures and containers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions