Nitya Raut has Published 276 Articles

How to update ui from Intent Service in android?

Nitya Raut

Nitya Raut

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

2K+ Views

Before getting into example, we should know what Intent service is in android. Intent Service is going to do back ground operation asynchronously. When user call startService() from activity , it doesn’t create instance for each request. It going to stop service after done some action in service class or ... Read More

C++ Program to Count Inversion in an Array

Nitya Raut

Nitya Raut

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

635 Views

Count inversion means the number of switches required to make an array sorted. Inversion count = 0, when array is sorted. Inversion count = maximum, when the array sorted in reverse order.Let us develop a C++ program to count Inversion in an Array.AlgorithmBegin    Function CountInversionArray has arguments a[], n ... Read More

How add a unique key constraint to a column of a table in a database using JDBC API?

Nitya Raut

Nitya Raut

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

413 Views

You can add a unique constraint to a column using the ALTER TABLE commandSyntaxALTER TABLE table_name ADD CONSTRAINT MyUniqueConstraint UNIQUE(column1, column2...);Assume we have a table named Dispatches in the database with 7 columns namely id, CustomerName, DispatchDate, DeliveryTime, Price and, Location with description as shown below:+--------------+--------------+------+-----+---------+-------+ | Field     ... Read More

How to add a NOT NULL constraint to a column of a table in a database using JDBC API?

Nitya Raut

Nitya Raut

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

307 Views

You can add a not null constraint to a column of a table using the ALTER TABLE command.SyntaxALTER TABLE table_name MODIFY column_name datatype NOT NULL;Assume we have a table named Dispatches in the database with 7 columns namely id, CustomerName, DispatchDate, DeliveryTime, Price and, Location with description as shown below:+--------------+--------------+------+-----+---------+-------+ ... Read More

C++ Program to find the median of two sorted arrays using binary search approach

Nitya Raut

Nitya Raut

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

116 Views

We shall develop a C++ program to find the median of two sorted arrays using Binary Search approach.AlgorithmBegin    Function median() with both the arrays and the start and end indexes of each array, which have two arrays and their respective elements as argument.       A) first calculate ... Read More

C++ Program to Implement Sorted Circularly Doubly Linked List

Nitya Raut

Nitya Raut

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

557 Views

In data structure, Linked List is a linear collection of data elements. Each element or node of a list is comprising of two items - the data and a reference to the next node. The last node has a reference to null. Into a linked list the entry point is ... Read More

How to set auto-increment to an existing column in a table using JDBC API?

Nitya Raut

Nitya Raut

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

466 Views

You can add/set an auto increment constraint to a column in a table using the ALTER TABLE command.SyntaxALTER TABLE table_name ADD id INT PRIMARY KEY AUTO_INCREMENTAssume we have a table named Dispatches in the database with 7 columns namely id, CustomerName, DispatchDate, DeliveryTime, Price and, Location with description as shown ... Read More

C++ Program to Implement Sorted Circularly Singly Linked List

Nitya Raut

Nitya Raut

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

362 Views

In data structure, Linked List is a linear collection of data elements. Each element or node of a list is comprising of two items - the data and a reference to the next node. The last node has a reference to null. Into a linked list the entry point is ... Read More

Virtual Functions and Runtime Polymorphism in C++

Nitya Raut

Nitya Raut

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

5K+ Views

Virtual functions in C++ use to create a list of base class pointers and call methods of any of the derived classes without even knowing kind of derived class object. Virtual functions are resolved late, at runtime.The main use of virtual function is to achieve Runtime Polymorphism. Runtime polymorphism can ... Read More

Virtual Destructor in C++

Nitya Raut

Nitya Raut

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

1K+ Views

Deleting a derived class object using a pointer to a base class, the base class should be defined with a virtual destructor.Example Code#include using namespace std; class b {    public:       b() {          cout

Advertisements