/DSA

Code base for data structures & algorithms and good coding solutions

Primary LanguageJava

DSA

@Code base for data structures & algorithm's and good coding solutions

Bridge.java

Imagine a bridge build with especific number of blocks and user can check the bridge is safe or not, by entering '_' for block 'x' for no block/needed, on this bases program find out bridge is safe or not!

Notify.java

This Java program simulates journey notifications by calculating and displaying travel progress based on user inputs for starting location, destination, total distance, and average speed. The user inputs these details, and the program computes the total time required for the journey. The program then iterates through each hour of the journey, calculating the distance covered, remaining distance, and remaining time, providing periodic updates. The getNotify method is responsible for these calculations and displays, ensuring that the user is informed about the progress of their journey at each hourly interval.

Expenses.java

An expenses calculator helps track and manage spending across various categories like groceries, utilities, entertainment, etc. It calculates total expenditures and compares them against set budgets. Suggestions based on budget can include tips to save, allocate funds wisely, or adjust spending habits to meet financial goals effectively.

Bubble.java

here, this file i solove the bubble sorting through java language and it's basic sorting technique which have Big O(n^2) times.

Bit.java

Add bit manipulation methods with user choice

  • Implemented methods for bit manipulation: getBit, setBit, clearBit, and updateBit.
  • Added a user menu in the main method to choose which bit manipulation operation to perform.
  • Used a switch statement to call the appropriate method based on user input.
  • Included input validation and error handling for invalid choices.
  • Ensured Scanner objects are properly closed after use.

Warmup.java

This Java program simulates the switch keyword to practice set of java refesher for the do code to check their output and varify it. for run in terminal.

Array.java

  • In Array.java file, i create seperate class named Reverse to reverse the static array through call by object in main method.
  • add MaxMinElement class by which i implement seaching to get the maximum and minimum value from the array & call by object named mm.
  • Add new kthElement class, to solve the Kth element maxximum or minimum value saerching by class and object too.

PlaceValue.java

This Java program prompts the user to enter a number and a digit, then determines the place value of the specified digit within the number. It extracts each digit from the number, starting from the least significant digit, and stores them in an array. The program then checks each digit against the specified digit, calculates its place value (such as units, tens, hundreds), and prints the result. If the digit is not found, the program notifies the user accordingly.

PaindromeString.java

In this code, i create a program to solve the to check the entered dtring is palindomen or not.