Trending

#datastructureandalgorithm

Latest posts tagged with #datastructureandalgorithm on Bluesky

Latest Top
Trending

Posts tagged #datastructureandalgorithm

Preview
70+ Coding Interview Questions for Software Engineers and Developers in 2025 There are a lot of computer science graduates and programmers applying for programming, coding, and software development roles at startups like Uber and Netflix and big organizations like Amazon, Microsoft, and Google.  They are also quite popular on service-based companies like Infosys, TCS, or Luxsoft, but many of them have no idea of what kind of programming interview questions to expect when you’re applying for a job with these companies. Things have also changed a lot in the last few years and coding interviews have become tougher. Now you need to go through a couple of coding interview rounds but you also need to prepare for System design problems which wasn’t normal in the last decade. --- Java Interview questions and tutorials

#coding #datastructureandalgorithm

0 0 0 0
Preview
How to Create and Initialize Anonymous Array in Java? Example Anonymous arrays in Java is an Array without any name, just like Anonymous inner classes and policy of using Anonymous array is just create, initialize and use it, Since it doesn't have any name you can not reuse it. The anonymous array was a good way to implement variable argument methods before Java introduced varargs in Java5. You had the liberty to create an array of any length and pass that to a method that operates on an anonymous array. Classical example of such variable argument method is aggregate function like sum(), avg(), min(), max() etc. --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#Array #corejava #datastructureandalgorithm

0 0 0 0
Preview
How to Find all Pairs in Array of Integers Whose sum is Equal to a Given Number in Java? Solution Example Practicing coding problems are very important to do well in any programming interview. You should at your best on data structures like an array, linked list, and string to clear any programming interview and believe me, you can not do this in one day or one week. It's rather a long process of learning through coding, and that's where these small coding problems help. Today, we are going to look at another interesting programming question from the array; write a program to find all pairs of integers whose sum is equal to a given number. For example, if the input integer array is {2, 6, 3, 9, 11} and the given sum is 9, the output should be {6,3}. --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#Array #corejava #datastructureandalgorithm

0 0 0 0
Preview
How to Find Multiple Missing Integers in Given Array of Numbers with Duplicates in Java? Hello guys, It's been a long time since I have discussed any coding or algorithm interview questions, so I thought to revisit one of the most popular array-based coding problems of finding missing numbers in a given array of integers. You might have heard or seen this problem before on your programming job interviews and you might already know how to solve this problem. But, there are a lot of different versions of this problem with increasing difficulty levels which interviewers normally use to confuse candidates and further test their ability to adapt to frequent changes, which is key to surviving in the ever-changing software development world. --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#Array #CodingInterviewQuestion #datastructureandalgorithm

0 0 0 0
Preview
How to find smallest number from int array in Java, Python, JavaScript and Golang? [Solved] This is the second part on this array interview question. In the first part, I have showed you how to find the largest element in array, and in this part, you will learn how to find the smallest number from an integer array. We will solve this problem on Java programming language but you are free to solve in any other programming language like Python or JavaScript. Most interviewer doesn't care much about which programming language you are solving the question, if you can provide working solution. This one is also a popular Java programming exercise which is taught in school and colleges and give in homework to teach programming to kids and engineering graduates.  --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#Array #Codingproblems #datastructureandalgorithm

0 0 0 0
How to check if a given linked list is a palindrome in Java? Example [Solved] Hello guys, if you are wondering how to check if a given linked list is a palindrome in Java then you have come to the right place. In the past, I have shared how to check if a given String is palindrome or a given number is a palindrome, and in this article, I will teach you how to check if a linked list is a palindrome. But before that, let's revise what is a palindrome? A palindrome is a phrase, word or number, or other sequence of characters that reads the same backward ad forward. Meaning that It gives you the same thing when read forward or backward. For example, Mary, Army, Madam, racecar, 1-2-3-2-1, noon, level, Hannah, civic, etc. --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#Codingproblems #datastructureandalgorithm #linkedlist

0 0 0 0
Preview
Radix sort in Java with Example Hello guys, in one of the interview I was asked to name any O(n) sorting algorithm. I was shocked because I only knew about QuickSort and Mergesort whose best time is O(NLogN), so I couldn't answer that question. After the interview, the first thing I did was to Google about O(n) sorting algorithm and I was surprised to find that there are many algorithms like Radix Sort and Counting Sort and Bucket Sort which can provide O(n) performance. So, I learn them and wrote articles about them like in previous article I explained about Counting Sort algorithm and in this article, I will explain Radis sort like what it is and how it works. In Radix sort, we are sorting by comparing individual digits from the last one to the first one. In essence, radix sort is like this: sort elements by the last digit.  --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#coding #datastructureandalgorithm #programming

1 0 0 0
Preview
How to loop through an Array in Java? Example Tutorial Hello there, If you want to loop over an array in Java but not sure how to do that then you have come to the right place. Earlier, I have shared many Java array tutorials and the best Java courses for beginners, and today, I am going to teach you how to iterate over an array in Java. There are multiple ways to loop over an array in Java, like you can use a for loop, an enhanced for loop, a while loop, or a do-while loop. Since while and do-while needs a condition to terminate they often depend upon the content of the array like stop when the current element is null or even or odd etc. If you just want to iterate over an array to access each element like loop over an array and print each entry then you should use either for loop or the enhanced for loop. --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#Array #corejava #datastructureandalgorithm

0 0 0 0
Preview
How to sort an Array in Java? Ascending and Descending Order Example As a Java programmer, quite often you would need to sort array in Java luckily java.util.Arrays class provides several utility methods to sort an array in Java. You can sort different types of array in Java like array of primitive data types, object or int, String, etc. Arrays are in java.util package and exposed all sorting related methods as static utility functions. you can access sort() as Arrays.sort() and just pass your array and it will sort that array object by comparing them in the order implemented in the compareTo() method if the class implements Comparable interface.  --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#Array #corejava #datastructureandalgorithm

0 0 0 0
Preview
Difference between Comparison (QuickSort) and Non-Comparison (Counting Sort) based Sorting Algorithms? Example For many of you, this might be a surprise that how you can sort or arrange items without comparing them with each other, but it's possible. There are some sorting algorithms that perform sorting without comparing the elements rather than making certain assumptions about the data they are going to sort. The process is known as non-comparison sorting and algorithms are known as the non-comparison-based sorting algorithms. Non-comparison sorting algorithms include Counting sort which sorts using key-value, Radix sort, which examines individual bits of keys, and Bucket Sort which examines bits of keys.  --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#datastructureandalgorithm #Programminginterviewquestion

0 0 0 0
Preview
Difference between Stack and Queue Data Structure in Java? Example Stack and Queue are two of the important data structures in the programming world and have a variety of usage. As opposed to the array and linked list, which are considered primary data structures, they are secondary data structures that can build using an array or linked list. You can use Stack to solve recursive problems and Queue can be used for ordered processing. The difference between Stack and Queue Data structure is also one of the common questions not only in Java interviews but also in C, C++, and other programming job interviews. --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#corejavainterviewquestion #datastructureandalgorithm

0 0 0 0
Preview
Recursive Binary Search Algorithm in Java - Example Tutorial The binary search algorithm is one of the most famous search algorithms in computer science. It allows you to search a value in logarithmic time i.e. O(logN), which makes it ideal to search a number on a huge list. For example, in order to search a number in a list of 1 million numbers will take around 210 comparisons compared to 1 million comparisons required by the linear search algorithm. The only thing is that the list must be sorted before you can use a binary search algorithm and it must support index-based search.  --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#Array #corejava #datastructureandalgorithm

0 0 0 0
Preview
How to implement Bucket Sort in Java? [Solved] - Example Tutorial In recent years, one of the questions I have increasingly seen in programming job interviews is about constant time sorting algorithms like do you know any O(n) sorting algorithm? how do they work? When I first encountered this question, I had no idea whether we can sort in constant time because even some of the fastest sorting algorithms like QuickSort or MergeSort take O(N log N) time for sorting on their average case. After some research, mainly by going through the classic CLRS book and this DS and Algorithms course by Tim Buchalka and Goran Lochert on Udemy, I come to know that there indeed are some constant time or linear time sorting algorithms like bucket sort, counting sort, and radix sort, which can sort an array in O(n) time but they work with only a special set of input. --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#datastructureandalgorithm #Sortingalgorithm

0 0 0 0
Preview
6 ways to declare and initialize a two-dimensional (2D) String and Integer Array in Java - Example Tutorial Declaring a two-dimensional array is very interesting in Java as the Java programming language provides many ways to declare a 2D array and each one of them has some special things to learn about. For example, It's possible to create a two-dimensional array in Java without specifying the second dimension, sounds crazy right? but it's possible because a two-dimensional array in Java is nothing but an array of array. You can even create a two-dimensional array where each subarray has a different length or different type, also known as a heterogeneous array in Java. This means it's possible to create a two-dimensional array with variable column length in Java. --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#Array #corejava #datastructureandalgorithm

0 0 0 0
Preview
How to Count Number of Leaf Nodes in a Binary Tree in Java ? [ Iterative and Recursive Solution] Hello guys, today I am going to talk about an interesting binary tree-based coding problem from Programming Job interviews. If you have attended a couple of technical interviews then there is a good chance that you already have seen this question about counting the number of leaf nodes in a binary tree. If you know how to solve this problem then it's well and good but if you haven't don't worry, you will learn in this article. If you follow this blog then you might know that I have discussed a lot of data structure and algorithms problems here, including array, linked list, hash table, binary tree, and binary search tree.  --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#binarytree #datastructureandalgorithm

0 0 0 0
Preview
Iterative QuickSort Example in Java - without Recursion The quicksort algorithm is one of the important sorting algorithms. Similar to merge sort, quicksort also uses divide-and-conquer hence it's easy to implement a quicksort algorithm using recursion in Java, but it's slightly more difficult to write an iterative version of quicksort. That's why Interviewers are now asking to implement Quicksort without using recursion. The interview will start with something like writing a program to sort an array using a quicksort algorithm in Java and most likely you will come up with a recursive implementation of quicksort as shown here. As a  follow-up, the Interviewer will now ask you to code the same algorithm using Iteration. --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#datastructureandalgorithm #Sortingalgorithm

0 0 0 0
3 Examples to Print Array Elements/Values in Java - toString and deepToString from Arrays Printing array values in Java or values of an array element in Java would have been much easier if  arrays are allowed to directly prints its values whenever used inside System.out.println() or format and printf method, Similar to various classes in Java do this by overriding toString() method. Despite being an object, array in Java doesn't print any meaningful representation of its content when passed to System.out.println() or any other print methods. If you are using array in method argument or any other prominent place in code and actually interested in values of an array then you don't have much choice than for loop until Java 1.4. --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#Array #corejava #datastructureandalgorithm

0 0 0 0
Preview
Recursion in Java with Example – Programming Tutorial for Beginners Recursion is one of the tough programming techniques to master. Many programmers working on both Java and other programming languages like C or C++ struggles to think recursively and figure out the recursive pattern in the problem statement, which makes it is one of the favorite topics of any programming interview. If you are new to Java or just started learning Java programming language and you are looking for some exercise to learn the concept of recursion then this tutorial is for you.  --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#coding #corejava #datastructureandalgorithm

1 0 0 0
Preview
How to implement Linear Search Algorithm in Java? Example tutorial In the last article about searching and sorting, you have learned the binary search algorithm and today I'll teach you another fundamental searching algorithm called Linear search. Linear search is nothing but iterating over the array and comparing each element with the target element to see if they are equal since we search the array sequential from start to end, this is also known as sequential search or linear search. It is very slow as compared to binary search because you have to compare each element with every other element and is definitely not suitable for a large array. It's practically useful only in the case of a small array of up to 10 to 15 numbers. In the worst case, you need to check all elements to confirm if the target element exists in an array or not. --- Java Interview questions and tutorials

#datastructureandalgorithm #SortingAlgorithm

0 0 0 0
Preview
How to find the maximum sum level in binary tree in Java? Example Tutorial Hello guys, if you are preparing for a coding interview and wondering how to find the maximum sum level in a given binary tree in Java then you have come to the right place. I have been sharing binary tree coding problems for the last few months and in the past, we have seen questions like finding kth smallest element and finding the lowest common ancestor of a binary tree in Java in this article, you will learn how to find the maximum sum level in a given binary tree of integers or numbers. But, before finding the maximum sum level of a binary tree in java, we need to have a good understanding of a binary search tree. Both theoretical knowledge and how to implement binary search tree in Java is important to solve tree-based coding problems.  --- Java Interview questions and tutorials

#binarytree #datastructureandalgorithm

0 0 0 0
Preview
How to Print all leaf Nodes of a Binary tree in Java [ Coding Interview Questions] This is another interesting coding problem that is based on a binary tree and mostly asked beginner programmers. If you have some experience in solving binary tree-based problems then it's rather easy to solve because, like many other binary tree algorithms, you can use recursion to print all leaf nodes of a binary tree in Java. Since the tree is a recursive data structure, you can apply the same algorithm to both the left and right subtree. In order to solve this problem, the first thing you should know is what is a leaf node because if you don't know that then you won't be able to solve the problem. Well, a leaf node is the one whose left and right child nodes are null. --- Java Interview questions and tutorials

#binarytree #datastructureandalgorithm

0 0 0 0
Preview
Top 25 Linked List Coding Interview Questions for Java Programmers Hello guys, if you are preparing for Software Development interview or want to become a Software Engineer then you must pay full attention to two important topics: first is Data Structure and Algorithms, and second is System Design. These two topics are very essential and you will always find questions from these in any coding interview. They are also the most difficult to crack as they are very vast, no matter how much you will prepare there will be certain questions which you don't know but if you have solid knowledge of fundamental data structure like array, linked list, binary tree, hash table, heap, and graphs as well sorting and searching algorithms like quicksort, merge sort, selection sort, insertion sort, binary tree as well advanced String and graph algorithms then you can still do well. --- Java Interview questions and tutorials

#datastructureandalgorithm #interviewquestions

0 0 0 0
Preview
[Solved] How to check if two String are Anagram in Java? Example Hello guys, if you are preparing for Coding interviews then you already know that String is one of the most popular topics. You will be bound to get some string-based coding problems on interviews. If not, you have come to the right place becuase we'll look at one of the most popular String programming interview questions today,  how to check if two given strings are Anagram of each other? Two String is said to be an anagram of each other, if they contain exactly the same characters but in a different order. For example "ARMY" and "MARY" are an anagram of each other because they contain the exact same characters 'A', 'R', 'M' and  'Y'. --- Java Interview questions and tutorials

#CodingProblems #datastructureandalgorithm

0 0 0 0
Preview
How to Convert an Array to Comma Separated String in Java - Example Tutorial The simplest way to convert an array to comma separated String is to create a StringBuilder, iterate through the array, and add each element of the array into StringBuilder after appending the comma. You just need Java 1.5 for that, even if you are not running on Java 5, you can use StringBuffer in place of StringBuilder. The joining of String has got even easier in JDK 8, where you have got the join() method right in the String class itself. The join() method takes a delimiter and a source, which can be an array or collection, and returns a String where each element is joined by a delimiter. --- Java, Unix, Tibco RV and FIX Protocol Tutorial

#Array #corejava #datastructureandalgorithm

0 0 0 0
Preview
How to Find/Print Leaf nodes in a Binary Tree in Java without Recursion - Example In the last article, you have learned how to print all leaf nodes of a binary tree in Java by using Recursion, a useful technique to solve binary tree problems and in this article, we'll answer the same question without using Recursion. Why should we do this? Well, it's a typical pattern on a programming job interview to solve the same problem using both Recursion and Iteration. Since some questions are easy to solve using recursion like linked list problems, binary tree-based problems, tower of Hanoi, or Fibonacci series but their non-recursive solution is comparatively tricky, the interviewer tests candidates against this shift in the algorithm. --- Java Interview questions and tutorials

#binarytree #datastructureandalgorithm

0 0 0 0
Preview
Difference between Binary Tree, Binary Search Tree (BST), and Balanced Tree (AVL and Red Black Tree)? Hello guys, if you are preparing for technical interview for Software Development job then you must prepare well for Data Structure and Algorithms. It is often the difference between selection and non-selection and when it comes to Data Structure, binary search tree is one of the tough topic to master. In the past, I have shared 100+ data structure questions and 40+ binary tree questions and today, I am going to share one of the popular theory or concept questions related to binary tree data structure.  The Tree data structure is one of the essential data structures, but unfortunately, many programmers don't pay enough attention to learning Trees, particularly advanced tree data structures like balanced trees like AVL and Red-Black tree.  --- Java Interview questions and tutorials

#binarytree #datastructureandalgorithm

0 0 0 0
Preview
[Solved] How to Find Repeated Characters in a given String with count in Java? Example This is another interesting coding problem or programming exercise for beginner programmers. How do you find repeated or duplicate characters in a given String and their count? You can solve this coding problem in any programming language of your choice like Java, Python, Ruby, or even JavaScript. I'll explain the logic and solution which is easy to implement in the above programming languages and I'll provide code in Java, which is my favorite programming language.  In order to solve this problem, You need to first check if a String contains any duplicate characters or not, and then if it contains any duplicate letters then find out how many times they appear in the given input String. --- Java Interview questions and tutorials

#CodingProblems #datastructureandalgorithm

0 0 0 0
Preview
Post order traversal Algorithms for Binary Tree in Java with example In the last couple of articles, you have learned about pre-order and in-order tree traversal algorithms in Java, and today, you will learn about the post-order traversal in a binary tree. It is the toughest of all three tree traversal algorithms and programmers generally struggle to implement this when asked in a coding interview. Hence it makes sense to understand and practice this algorithm before going for the interview. The post order traversal is also a depth-first algorithm because you go deep before you visit other nodes on the same level. --- Java Interview questions and tutorials

#binarytree #datastructureandalgorithm

0 0 0 0
Preview
How to check if an array includes a value in JavaScript? Example Tutorial Hello Javascript developers, if you are wondering how to check if an array contains a particular value or not in Javascript then you have come to the right place. In the last article I showed you how to remove empty elements from the JavaScript array and today I will show you 3 ways to check if an array contains a particular value in Javascript. I have been sharing a lot of Javascript resources like the best JavaScript courses, books, websites, and Javascript interview questions, along with many JavaScript and React tutorials, and today, we are going to see an example of the includes() method of the array in JavaScript to find out if an array has a particular value or not.   --- Java Interview questions and tutorials

#datastructureandalgorithm #JavaScript

0 0 0 0
Preview
QuickSort Algorithm Example in Java using Recursion - Tutorial The Quicksort algorithm is one of the very popular sorting algorithms in programming, often used to sort a large array of numbers. Though there is numerous algorithm available to sort a list of objects, including integer, string, and floating-point number, quicksort is best for general purpose. It's a divide and conquers algorithm, where we divide the given array with respect to a particular element, known as 'pivot' such that the lower partition of the array is less than the pivot and upper partition elements of the array are higher than the pivot. --- Java Interview questions and tutorials

#corejava #datastructureandalgorithm

0 0 0 0