Rust icon indicating copy to clipboard operation
Rust copied to clipboard

delete head is not returning None, causing length update overflow

Open zinking opened this issue 2 years ago • 6 comments

https://github.com/TheAlgorithms/Rust/blob/6189823b425df0a172a60d87f3b2e982f3e5dee2/src/data_structures/linked_list.rs#L199

it looks the implementation of drop is flawed and delete head is not returning none to terminate the drop process appropriately.

zinking avatar Jan 28 '23 01:01 zinking

@imp2002 ^^^

siriak avatar Jan 28 '23 11:01 siriak

Hey, Is this open to take ?

RoKu1 avatar Jan 29 '23 01:01 RoKu1

Yes, it is

siriak avatar Jan 29 '23 12:01 siriak

Hey will take it. As I see if delete_head does not return None, still the drop should terminate. Can you give me bit context as to what is causing this lenth update overflow.

RoKu1 avatar Jan 31 '23 04:01 RoKu1

@RoKu1 https://github.com/zinking/Coursera/blob/master/rust-course/src/ds/linked_list.rs it could be my re-imp problem. I ended up using linked list size as loop variable.

zinking avatar Feb 07 '23 11:02 zinking

Hi, I took a look at your implementation. The current in implementation I do not see anywhere that the delete_head won't return None. I guess this can be closed @siriak

RoKu1 avatar Feb 08 '23 14:02 RoKu1

@zinking please add more information, and I'll reopen this issue if it's still relevant

siriak avatar Feb 09 '23 18:02 siriak