Nancy Den has Published 330 Articles

Period plusDays() method in Java

Nancy Den

Nancy Den

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

122 Views

An immutable copy of the Period object where some days are added to it can be obtained using the plusDays() method in the Period class in Java. This method requires a single parameter i.e. the number of days to be added and it returns the Period object with the added ... Read More

C++ Program to Implement self Balancing Binary Search Tree

Nancy Den

Nancy Den

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

1K+ Views

AVL tree is a self-balancing Binary Search Tree where the difference between heights of left and right subtrees cannot be more than one for all nodes.This is a C++ Program to Implement self Balancing Binary Search Tree.Begin class avl_tree to declare following functions: balance() = Balance the tree by getting ... Read More

Period equals() method in Java

Nancy Den

Nancy Den

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

97 Views

The equality of two Periods can be determined using the equals() method in the Period class in Java. This method requires a single parameter i.e. the Period object to be compared. Also it returns true if both the Period objects are equal and false otherwise.A program that demonstrates this is ... Read More

C++ Program to Implement Splay Tree

Nancy Den

Nancy Den

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

2K+ Views

This is a C++ program to implement Splay Tree.Class Descriptions:Begin    class SplayTree has the functions:       Create a function Splay() to implement top-down splay tree.       Here head.rch points to the Left tree and head.lch points to the right tree.       Create a ... Read More

Set position with seekg() in C++ language file handling

Nancy Den

Nancy Den

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

3K+ Views

seekg() is a function in the iostream library that allows us to seek an arbitrary position in a file. It is mainly used to set the position of the next character to be extracted from the input stream from a given file in C++ file handling.Syntaxistream&seekg(streamoff offset, ios_base::seekdir dir); istream&seekg(streampos ... Read More

Exception Handling in C++ vs Java

Nancy Den

Nancy Den

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

513 Views

There are key differences in Exception Handling in C++ vs JavaException handling in javaException handling in C++Only throwable objects can be thrown as objects.All types can be thrown as exceptionIn java, finally is a block that is executed after try catch block for cleaning up.In C++ there is no existence ... Read More

C++ Program to Implement Dijkstra’s Algorithm Using Set

Nancy Den

Nancy Den

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

466 Views

This is a C++ Program to Implement Dijkstra’s Algorithm using Set. Here we need to have two sets. We generate a shortest path tree with given source node as root. One set contains vertices included in shortest path tree and other set includes vertices not yet included in shortest path ... Read More

How to insert images in Database using JDBC?

Nancy Den

Nancy Den

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

4K+ Views

The setBinaryStream() method of the PreparedStatement interface accepts an integer representing the index of the parameter and an InputStream object and sets the parameter to the given InputStream object. Whenever you need to send very large binary value you can use this method.And SQL databases provide a datatype named Blob (Binary ... Read More

C++ Program to Implement First Fit Decreasing for 1-D Objects and M Bins

Nancy Den

Nancy Den

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

110 Views

Here is a C++ Program to implement First Fit Decreasing for 1-D objects and M binsRequired functions and pseudocode:Begin    function binPack() returns number of bins required.    Initialize binC = 0    Initialize an array to store binVal.    Place items one by one.    function sort() to perform ... Read More

Write an JDBC example for inserting value for Blob datatype into a table?

Nancy Den

Nancy Den

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

2K+ Views

Assume we already have a table named MyTable in the database with the following description.+-------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+--------------+------+-----+---------+-------+ | Name | varchar(255) | YES | ... Read More

Advertisements