69 CS651 Lecture Notes - Lecture 32: Linked List, Source Code Editor

8 views2 pages
L32: LINKED LIST OPERATIONS In Java - REVERSE,
ADD, DELETION | Lesson 32 | DSA In
Java@CodingNinjasIndia
Coding Ninjas
This video is a part of new playlist of videos on data structures and algorithm in
Java by coding Ninjas.. in this video, we will be covering implementation of add
method and remove method. we will see how to insert a element at a particular
index in the linked list and how to delete a node from a linked list by doing a
code studio. Problem. this is how we can add an element to the linked list by
using add method only. if we want to add the element at the first position or the
last position, we will just have to write dot add last method. let us check whether
these elements are placed at the right position in this lick clip so after addition,
let us check what will get the output. after insertion by index. I have inserted
days of week at the zeroth index and middle at the fourth index and after that at
the end, we I have added and at the ninth index. So. This is how we can add
element at the first index or middle or the last of the in the linked list. by using
remove method, we can remove element from linked list, so it works similarly, so
you can see the code here..
Code Ninja is a free platform which provides free online code editor and
compiler in C plus plus plus Java Python, Python Python Code Studio.. Code
Studio is the best platform to prepare for coding interviews and you can find the
top interview questions and their solution guided path to learn various topics in
DsA. the element will be two five seven and ten and another linked list is minus
eight three four minus two one. So in this we will be deleting four. minus one
indicates that the end of the linked list. It will not be considered in linked list..
After this we can. Finally we we will delete the element Uh temp. We will then
delete the temp pointer so finally our element is deleted. the time complexity of
this code will be of one as all the operations are performed in constant time and
the talking. about the space complexity space complexity will also be of 1 as we
are using the constant extra time extra memory.. this problem. You can also
submit the code here and win the exciting badges..
Code studio is based on reverse linked list based on reversal link list. you are
given a single linked list of integer. You need to reverse the linked list by
changing the links between the nodes, so you do not need to print anything.
Just return the head of the reversed linked list. we will be doing this code by
using this recursion approach. the time complexity of this code will be of n.
Where n is a number of nodes in the linked list. the space complexity is also
often often where n n is the number of node in the list, and there can be at most
Unlock document

This preview shows half of the first page of the document.
Unlock all 2 pages and 3 million more documents.

Already have an account? Log in

Document Summary

L32: linked list operations in java - reverse, Add, deletion | lesson 32 | dsa in. This video is a part of new playlist of videos on data structures and algorithm in. I have inserted days of week at the zeroth index and middle at the fourth index and after that at the end, we i have added and at the ninth index. Code ninja is a free platform which provides free online code editor and compiler in c plus plus plus java python, python python code studio code. Studio is the best platform to prepare for coding interviews and you can find the top interview questions and their solution guided path to learn various topics in. Dsa. the element will be two five seven and ten and another linked list is minus eight three four minus two one. So in this we will be deleting four. minus one indicates that the end of the linked list.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions