Doubly Linked List Code

  Рет қаралды 48,209

WilliamFiset

WilliamFiset

Күн бұрын

Пікірлер: 21
@sportsonglobe
@sportsonglobe 4 жыл бұрын
Thanks for the awesome explanation. I am also commenting the code for reversing the doubly linked list if it helps someone. public void reverse() { if (isEmpty()) return; Node temp = null; Node current = first; while (current != null) { temp = current.previous; current.previous= current.next; current.next = temp; current= current.previous; } if (temp != null) { first = temp.previous; } }
@rajanjha673
@rajanjha673 2 жыл бұрын
Hello William Is it necessary to iterate in a clear method? What if we just set head and tail to null in java garbage collector should automatically reclaim that memory right?
@svrmmb
@svrmmb Жыл бұрын
I believe it was primarily done with consideration for languages that lack garbage collection, such as C/C++.
@shankar7435
@shankar7435 5 ай бұрын
It should be as per isolated islands logic of garbage collector clean up.
@VivekKumar-pp6cc
@VivekKumar-pp6cc 2 жыл бұрын
Here after using remove (obj) Only remains head data acording to your implementation Like DL.add(12); DL.add(13); DL.add(14); DL.remove(13) It will return [12] according to your implementation But actual linked list return after removing remaining all data. DL.add(12); JDL.add(13); JDL.add(14); JDL.remove(13) It will return [12,14] according to java linked list. Why it different?
@aaryanrohra5831
@aaryanrohra5831 2 жыл бұрын
Is that really java? That's really intimidating for beginners. Can you make tutorials for those as well?
@m1rac1e
@m1rac1e 2 жыл бұрын
this is meant for someone that's taken 1 - 2 intro programming courses. Data structures/algorithms is usually the 2nd/3rd class that a CS major takes. after introducing these concepts: basic syntax, basic overview of object oriented programming, classes, templates, pointers & more. After you learn all that stuff, then this will make sense.
@k_chirsoo1729
@k_chirsoo1729 5 ай бұрын
​@@m1rac1e Btw what's is for?
@vovanhung9406
@vovanhung9406 5 ай бұрын
@@k_chirsoo1729 it's call generics. u can search to learn more about it. but it's quite easy at all
@shankar7435
@shankar7435 5 ай бұрын
​​@@k_chirsoo1729That scares many from Java and I love that as it works as a crowd limiting factor of Java programmers. Otherwise this world would have been filled with all Java developers and it's very difficult to survive with Java as core bread and butter stuff for the people like me with average IQ. Thanks to Generics and it's scary look.😂😂😂❤❤❤
@mbil4l
@mbil4l 4 ай бұрын
@@k_chirsoo1729 Used for declaring data type at runtime instead of hardcoding it. So, if I send LL will contain ints if then strings and so on.
@cr6696
@cr6696 4 жыл бұрын
Thank you
@this_is_mac
@this_is_mac 3 жыл бұрын
You could've used one loop in remove()
@tiansuyu9965
@tiansuyu9965 8 ай бұрын
Yeh, I think the same. Doesn't matter the value is null or not, Null in most languages are singleton and comparison should work in that case.
@shivanishikha8552
@shivanishikha8552 4 жыл бұрын
is this series in java?
@jps78910
@jps78910 4 жыл бұрын
no
@shivanishikha8552
@shivanishikha8552 4 жыл бұрын
Then?
@volkanulker6432
@volkanulker6432 4 жыл бұрын
yes
Stack Introduction
11:39
WilliamFiset
Рет қаралды 42 М.
Learn Linked Lists in 13 minutes 🔗
13:24
Bro Code
Рет қаралды 383 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
It works #beatbox #tiktok
00:34
BeatboxJCOP
Рет қаралды 41 МЛН
Linked Lists Introduction
14:43
WilliamFiset
Рет қаралды 65 М.
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 317 М.
Naming Things in Code
7:25
CodeAesthetic
Рет қаралды 2,3 МЛН
Can You Beat Minecraft From One Grass Block?
35:27
Beppo
Рет қаралды 6 МЛН
Writing Code That Runs FAST on a GPU
15:32
Low Level
Рет қаралды 576 М.
LinkedList vs ArrayList in Java Tutorial - Which Should You Use?
11:43
Coding with John
Рет қаралды 619 М.
Introduction to Linked Lists (Data Structures & Algorithms #5)
18:47
Understanding B-Trees: The Data Structure Behind Modern Databases
12:39
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.