Skip to content

A collection of Java programs demonstrating data structures and algorithm implementations, including linked lists and palindrome checking.

Notifications You must be signed in to change notification settings

bedirhan-dikmen/Java-Data-Structures

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

8 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Java - Singly Linked List to Doubly Linked List Conversion

This project demonstrates how to convert a singly linked list into a doubly linked list in Java.
It also provides methods to print the list in both forward and reverse directions.

πŸ“Œ Features

  • Add elements to a singly linked list.
  • Convert the singly linked list into a doubly linked list.
  • Print the list in normal order.
  • Print the list in reverse order after conversion.

πŸš€ How It Works?

  1. The ekle(int veri) method adds new nodes to the singly linked list.
  2. The ciftYonList() method converts the list into a doubly linked list.
  3. The yazdir() method prints the list in the forward direction.
  4. The tersYazdir() method prints the list in reverse.

Palindrome Checker (Java)

This project is a Java program that checks whether a given word is a palindrome or not.
A palindrome is a word that reads the same forward and backward (e.g., "radar", "kayak", "level").

πŸ“Œ Features

  • Takes user input for a word.
  • Reverses the word using a stack.
  • Compares the original and reversed word to determine if it is a palindrome.
  • Displays the result on the screen.

πŸ›  Data Structure Used

  • A Stack (LIFO - Last In, First Out) is used to reverse the word.
  • StringBuilder is used to construct the reversed word.

πŸš€ How It Works?

  1. The program asks the user to enter a word.
  2. The word is pushed into a Stack character by character.
  3. The word is reversed using Stack operations.
  4. The original word is compared with the reversed word.
  5. If they match, the word is a palindrome; otherwise, it is not a palindrome.

Usage

Compile and run the program in any Java environment:

About

A collection of Java programs demonstrating data structures and algorithm implementations, including linked lists and palindrome checking.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages