Java2Blog
  • Home
  • Core Java
  • Tutorials
    • Spring
    • Spring Boot
    • Spring MVC
    • Java 8
    • Hibernate
  • Categories
    • Interview Questions
    • Spring Frameworks
    • Core java
    • Python
    • C++
  • NM
close
import_contacts

Java Tutorials

  • Core Java
  • Java Interview questions
  • Java 8 Stream
  • Java interview programs
import_contacts

Data structure and algorithm

  • Data structure in java
  • Data structure interview questions
import_contacts

Spring tutorials

  • Spring tutorial
  • Spring boot tutorial
  • Spring MVC tutorial
  • Spring interview questions

Interview

  • Algorithm Data Structure Interview LinkedList Queue
    12 October

    Implement Queue using Linked List in java

    If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions. In this post , we will see how to implement Queue using Linked List in java. Queue is abstract data type which demonstrates First in first out (FIFO) behaviour. We will implement same behaviour using Array. Although java provides implementation […]

    Read More
  • Algorithm Interview Sorting
    12 October

    Counting Sort in java

    Counting sort is special sorting technique used to sort elements between specific range. Lets say elements belong to range 1 to K , then Counting sort can be used to sort elements in O(N) times. Basic idea of counting sort to find number of elements less than X, so X can be put to its […]

    Read More
  • Algorithm Interview Sorting
    12 October

    Heap sort in java

    In this post, we will see how to implement heap sort in java. I will divide heap sort in multiple parts to make it more understandable. What is heap? A heap is a tree with some special properties, so value of node should be greater than or equal to(less than or equal to in case […]

    Read More
  • Algorithm Interview Binary Search Tree LinkedList
    10 October

    Convert sorted Linked List to balanced BST

    If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions. In this post , we will see how to convert sorted LinkedList to balanced binary search tree. There are two ways to do it. Solution 1: It is very much similar to convert sorted array to BST. […]

    Read More
  • Algorithm Binary Search Tree Data Structure Interview
    10 October

    Convert sorted array to balanced binary search tree

    If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions. In this post ,  we will see how to convert sorted array to balanced binary search tree. Algorithm: You might know that inorder traversal of binary search tree results in sorted array. We will use this property […]

    Read More
  • Algorithm Interview Array
    06 October

    Find the Contiguous Subarray with Sum to a Given Value in an array

    Problem : Given an array of positive integer and given value X, find Contiguous sub array whose sum is equal to X. For example: [crayon-6835f03786034629966839/] Solution: Solution 1: Check all sub arrays and if current sum is equal to X, return. This will require two loops and if currentSum is greater than X tben try […]

    Read More
  • Algorithm Interview Array
    06 October

    Separate 0s and 1s in an array

    Problem : Given an array of 0’s and 1’s in random order , you need to separate 0’s and 1’s in an array. For example: [crayon-6835f0378618d266093516/] Solution : Solution 1: Count number of 0’s in the array. Lets say we get X 0’s Once we get the count, put X 0’s in the array and […]

    Read More
  • Algorithm Interview Array
    06 October

    find minimum element in a sorted and rotated array

    If you want to practice data structure and algorithm programs, you can go through data structure and algorithm interview questions. In this post, we will see how to find minimum element in sorted and rotated array. Problem: You are given an sorted and rotated array as below: [crayon-6835f0378638b581696688/] If you note that array is sorted and […]

    Read More
  • Algorithm Algorithm Interview Array
    06 October

    Maximum difference between two elements such that larger element appears after the smaller number

    If you want to practice data structure and algorithm programs, you can go through 100+ java coding interview questions. Given array of integers, find Maximum difference between two elements such that larger element appears after the smaller number For example: [crayon-6835f037864af063336293/] Algorithm: Lets say we have array arr[] of stock prices. We will track two variable :minElementTillNow and maxDifference. minElementTillNow will be […]

    Read More
  • keyboard_arrow_left Previous
  • 1
  • …
  • 10
  • 11
  • 12
  • 13
  • 14
  • …
  • 23
  • Nextkeyboard_arrow_right

Newsletter


Let’s be Friends

  • Facebook
  • Twitter
  • LinkedIn

© 2020-22 Java2Blog Privacy Policy