Skip to content

Serialize and Deserialize the Binary Tree added #5691

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

Closed
wants to merge 13 commits into from

Conversation

Aksshay88
Copy link

@Aksshay88 Aksshay88 commented Oct 10, 2024

  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

@codecov-commenter
Copy link

codecov-commenter commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 65.97%. Comparing base (8886e09) to head (c7634a0).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5691      +/-   ##
============================================
- Coverage     65.97%   65.97%   -0.01%     
- Complexity     4387     4388       +1     
============================================
  Files           602      602              
  Lines         16783    16783              
  Branches       3226     3226              
============================================
- Hits          11073    11072       -1     
- Misses         5265     5266       +1     
  Partials        445      445              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Aksshay88
Copy link
Author

@alxkm Finally added the algorithm .

@Aksshay88
Copy link
Author

@alxkm any changes need to be done ?

return root;
}

public static void main(String[] args) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please replace main with JUnit tests

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure will update and push it
thank you

@@ -0,0 +1,137 @@
import java.util.LinkedList; // Replace with specific imports
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you need this comment?

import java.util.LinkedList; // Replace with specific imports
import java.util.Queue;

// Define the TreeNode class to represent nodes in the binary tree.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This description would be better to have as javadoc


// Define the TreeNode class to represent nodes in the binary tree.
class TreeNode {
int val; // Value stored in the node
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments below for TreeNode are very obvious. The code loses clarity with them.


public class SerializeaBinaryTree {

// The 'serialize' method converts a binary tree into a string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please clean up your code from some obvious things like variable definitions and describe some important things in Javadocs.

Copy link

github-actions bot commented Dec 7, 2024

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution!

@github-actions github-actions bot added the stale label Dec 7, 2024
Copy link

Please reopen this pull request once you have made the required changes. If you need help, feel free to ask in our Discord server or ping one of the maintainers here. Thank you for your contribution!

@github-actions github-actions bot closed this Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants