Imagine entering the wilderness alone and attempting to survive only on what you can fit in a small backpack. Sounds challenging, doesn’t it? 10 people will be put to an ultimate test of human endurance, to survive as long as they can in complete isolation and limited resources. HISTORY TV18 brings to you Alone Season 3 premiering on 4 August 2018, every Saturday-Sunday at 10 PM.
August 02, 2018
July 29, 2018
Exceptions in Java 8 Streams and Lambda Expressions
Java 8 Lambda Expressions allow us to do functional programming, but sadly they don't deal with exceptions very well.
Handling Unchecked Exceptions
Let's say we have a list of integers and we are dividing a constant number (lets say 16) with every element of this list, we need to print result of this division.
List < Integer > myList = Arrays.asList(7, 9, 16, 25, 27);
myList.forEach(i - > System.out.println(16 / i));
Handling Unchecked Exceptions
Let's say we have a list of integers and we are dividing a constant number (lets say 16) with every element of this list, we need to print result of this division.
List < Integer > myList = Arrays.asList(7, 9, 16, 25, 27);
myList.forEach(i - > System.out.println(16 / i));
July 27, 2018
#Algorithm: Find first non-repeating character from a String
Write a method to find the first non-repeating character from a String?
GIT URL: Java Solution to find the first non-repeating character from a String
Solution 1: Using LinkedHashMap.
1). Create a LinkedHashMap, which will maintain the count.
2). Convert the input string into a char array, start iterating it and add each character in LinkedHashMap. If the character is already present in LinkedHashMap, increment the count.
3). Loop through LinkedHashMap and find the character with the count as 1.
#Algorithm: Generate Fibonacci In Java
Generate the Fibonacci recursively and iteratively in Java
In fibonacci series, next number is the sum of previous two numbers for example 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc. The first two numbers of fibonacci series are 0 and 1.
There are two ways to generate the fibonacci series: With iteration and with recursion.
In fibonacci series, next number is the sum of previous two numbers for example 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc. The first two numbers of fibonacci series are 0 and 1.
There are two ways to generate the fibonacci series: With iteration and with recursion.
July 26, 2018
July 25, 2018
July 23, 2018
Spring Singleton vs Singleton Pattern
What is the difference between Spring Singleton and Java Singleton?
Difference between Spring Singleton and Java Singleton is one of the common misunderstanding among Spring Framework developers.
If you are not already familiar about the Singleton design pattern, please read the blog-post related to various Design Patterns.
Difference between Spring Singleton and Java Singleton is one of the common misunderstanding among Spring Framework developers.
If you are not already familiar about the Singleton design pattern, please read the blog-post related to various Design Patterns.
I never considered having a different title for Laila Majnu: Imtiaz Ali
Imtiaz Ali has given Bollywood some of the most romantic tales in the recent past. His take on modern times love and relationships make him the most loved filmmaker amongst youth. He accepts that having to make a modern-day adaptation of the legendary Laila Majnu brought him sheer happiness but what was incommodious was to get the title of the movie – Laila Majnu.
July 21, 2018
July 20, 2018
ALTBalaji announces new show 'Baby Come Naa'
ALTBalaji is India’s largest platform for original and exclusive digital content with more than 15 million mobile plus web users and is available in over 90 countries. The digital platform currently offers 22 original shows in Indian languages across various genres such as romance, mystery, drama, and comedy. ALTBalaji also offers entertaining original shows for kids and have launched short, hilarious regional stand-up comedy videos in Marathi, Punjabi, Hindi, Gujarati, Tamil, and Telugu.
July 19, 2018
#Algorithm: Detect duplicate elements in Array
How to detect duplicate elements in Array in Java?
1). Brute Force: In this approach we will compare each element of Array to all other elements and returns true if it founds duplicates. FYI, this is not an efficient choice.
2). Using HashSet: If you just need to find if whther the array has duplicates of not, convert that array into Set. Since Set doesn’t allow duplicates, the size of the corresponding Set will be smaller than the original Array if Array contains duplicates otherwise the size of both Array and Set will be the same.
#Algorithm: Implement Stack using two Queues
How can we implement Stack using two Queues?
We are given a queue data structure, and we need to implement Stack using it.
Solution 1:
Queue has FIFO, but Stack is FILO. We will use two queues q1 and q2. We can make sure that newly entered element is always at the front of q1, so that pop operation just dequeues from q1. q2 is used to put every new element at front of q1.
We are given a queue data structure, and we need to implement Stack using it.
Solution 1:
Queue has FIFO, but Stack is FILO. We will use two queues q1 and q2. We can make sure that newly entered element is always at the front of q1, so that pop operation just dequeues from q1. q2 is used to put every new element at front of q1.
July 18, 2018
Subscribe to:
Posts (Atom)






