Skip to content
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

[FEATURE] Update "list" implementation #956

Open
ybrenning opened this issue Aug 24, 2022 · 8 comments
Open

[FEATURE] Update "list" implementation #956

ybrenning opened this issue Aug 24, 2022 · 8 comments
Assignees
Labels
dont-close This issue/pull request shouldn't be closed enhancement New feature or request

Comments

@ybrenning
Copy link
Contributor

Detailed description

I would like to overhaul the implementation in list.c as it currently seems to be implementing some kind of abstract version of a stack data structure. I would propose to change this to a kind of dynamic array, similar to how the list data type is used in Python or the ArrayList in Java.

I would also like to add some improved documentation in accordance with CONTRIUBUTING.md as well as basic testing to demonstrate the functionality of the list.

The current implementation only allows for pushing to the front of the "list" (no pop operator or possibility for deletion of elements) and has no way of displaying the contents of the list without converting it to an array first and then using a seperately implemented print function which seems unnecessarily convoluted.

Context

I think that this implementation would be a lot more fitting for the list data structure and would be more easy to understand as well as more flexible to use. It would allow for basic operations such as insertion, deletion and printing which aren't entirely possible yet. The improved documentation and simple tests would of course also help in making the code easier to understand.

Possible implementation

Use a struct which keeps track of the current size/length of the list, the current capacity which would allow for resizing and keeps track of the current maximum amount of elements and a pointer to the beginning of the actual elements of the list.

Additional information

No response

@ybrenning ybrenning added the enhancement New feature or request label Aug 24, 2022
@github-actions
Copy link
Contributor

This issue has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@Panquesito7
Copy link
Member

Thanks for your interest in contributing! 🚀
Would you like to work on all of that? 😃

Let us know if you need any help. Thank you.

@ybrenning
Copy link
Contributor Author

Sure, I would like to work on that :)

@JKP0495
Copy link

JKP0495 commented Oct 6, 2022

please assign this to me, i will do it in 2 days

@Panquesito7 Panquesito7 added the dont-close This issue/pull request shouldn't be closed label Oct 29, 2022
@Panquesito7
Copy link
Member

@ybrenning, are you still willing to work on this? Thanks.

@niranjank2022
Copy link
Contributor

@Panquesito7 @ybrenning Can I work on this issue? And, I would also like to hear what other methods needs to be included apart from the ones below?

append(int val)
insert(int val, int index)
pop()
remove(int index)
length()
printArray()
sort()
reverse()
index(int value)
get(int index)

@nikhilrajbhar17
Copy link

I can fix this,can you assign this to me?

@Sofiyan-coder
Copy link

@ybrenning can you assign me this task? I want to support and contribute to this project now and in the future. It would be an honor to be part of this amazing open-source project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dont-close This issue/pull request shouldn't be closed enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants