Nancy Den has Published 330 Articles

C++ Program to Find Fibonacci Numbers using Dynamic Programming

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

3K+ Views

The Fibonacci sequence is like this, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, ……In this sequence the nth term is the sum of (n-1)th and (n-2)th terms.To generate we can use the recursive approach, but in dynamic programming the procedure is simpler. It can store all ... Read More

C++ Program to Implement Radix Sort

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

4K+ Views

Radix sort is non-comparative sorting algorithm. This sorting algorithm works on the integer keys by grouping digits which share the same position and value. The radix is the base of a number system. As we know that in decimal system the radix or base is 10. So for sorting some ... Read More

How can we retrieve time from a table in JDBC?

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

325 Views

The ResultSet interface provides a method named getTime() this method accepts an integer parameter representing the index of the column, (or, a String parameter representing the name of the column) from which you need to retrieve the time value. To retrieve time value from a table −Register the driver class ... Read More

Fetch the key from a KeyValue Tuple in Java

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

94 Views

To fetch the key from a KeyValue tuple in Java, use the getKey() method. Let us first see what we need to work with JavaTuples. To work with KeyValue class in JavaTuples, you need to import the following package:import org.javatuples.KeyValue;Note: Download JavaTuples Jar library to run JavaTuples program. If you ... Read More

How to handle Null values while working with JDBC?

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

2K+ Views

SQL's use of NULL values and Java's use of null are different concepts. So, to handle SQL NULL values in Java, there are three tactics you can use:Avoid using getXXX( ) methods that return primitive data types.Use wrapper classes for primitive data types, and use the ResultSet object's wasNull( ) ... Read More

C++ Program to Implement Bucket Sort

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

2K+ Views

In the Bucket Sorting technique, the data items are distributed of a set of buckets. Each bucket can hold similar type of data. After distributing, each bucket is sorted using another sorting algorithm. After that all elements are gathered into the main list to get the sorted form.The complexity of ... Read More

Set key in the JavaTuples KeyValue class

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

83 Views

To set key in the JavaTuples KeyValue class, you need to use the setKey() method. Let us first see what we need to work with JavaTuples. To work with KeyValue class in JavaTuples, you need to import the following package:import org.javatuples.KeyValue;Note: Download JavaTuples Jar library to run JavaTuples program. If ... Read More

C++ Program to Implement Bubble Sort

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

14K+ Views

Bubble Sort is comparison based sorting algorithm. In this algorithm adjacent elements are compared and swapped to make correct sequence. This algorithm is simpler than other algorithms, but it has some drawbacks also. This algorithm is not suitable for large number of data set. It takes much time to solve ... Read More

How to insert Timestamp value in a database using JDBC program?

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

3K+ Views

Timestamp datatype in SQL is similar to Date (in SQL) both store day:month:year:hour:minute:second. In addition to this timestamp stores fractional seconds too.Inserting Timestamp in to a databaseThe PreparedStatement interface provides a method named setTimestamp() this method accepts two parameters an integer variable representing the parameter index of the place holder ... Read More

The add() method of Java AbstractSequentialList class

Nancy Den

Nancy Den

Updated on 30-Jul-2019 22:30:25

60 Views

The AbstractSequentialList class has the add(int index, E ele) method to add element to the specific position. You can also use the add() method inherited from AbstractList class.add(int index, E ele) methodThe syntax is as follows:add(int index, E ele)Here, index is where the element is to be inserted. The ele ... Read More

Advertisements