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

Adding implementation of reversing a linked list in java #1767

Merged
merged 4 commits into from
Nov 4, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions java/Reverse_linked_list.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
---
id: Reverse_Linked_List
id: reverse-linked-list
sidebar_position: 1
title: Reverse Linked List
sidebar_label: Reverse Linked List
description: "This document explains the reversing a linked list in java."
description: "This document explains reversing a linked list in java."
tags: [java, data structures, linked list]
---

# *Reverse Linked List*
# *Reversing a Linked List*

## *Description*

Expand Down Expand Up @@ -82,11 +82,9 @@ public class LinkedList {
}
```

- *Time Complexity*
-- O(n), where n is the number of nodes.
- *Time Complexity*: O(n), where n is the number of nodes.

- *Space Complexity*
--O(1), as only a constant amount of space is used.
- *Space Complexity*: O(1), as only a constant amount of space is used.

# *Conclusion*
In this article, we learned about reversing a linked list and implemented it in Java.
Loading