Jennifer Nicholas has Published 331 Articles

C++ Program to Implement Sorting of Less than 100 Numbers in O(n) Complexity

Jennifer Nicholas

Jennifer Nicholas

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

235 Views

To sort some small numbers in linear time we can use the counting sort technique.Counting sort is a stable sorting technique, which is used to sort objects according the keys that are small numbers. It counts the number of keys whose key values are same. This sorting technique is efficient ... Read More

C++ Program to Check Whether Graph is DAG

Jennifer Nicholas

Jennifer Nicholas

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

1K+ Views

A directed acyclic graph (DAG) is a graph that is directed and without cycles connecting the other edges. The edges of this graph go one way. This is a C++ program to check whether the graph is DAG.AlgorithmBegin Function checkDAG(int n):    intialize count = 0    intialize size = ... Read More

How to insert a row into a ResultSet object using JDBC?

Jennifer Nicholas

Jennifer Nicholas

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

312 Views

The insertRow() method of the ResultSet interface inserts a new row into the ResultSet object as well as the table.//Deleting a column from the ResultSet object rs.insertRow();Assume we have a table named cricketers_data with 6 records as shown below:+----+------------+------------+---------------+----------------+-------------+ | ID | First_Name | Last_Name  | Year_Of_Birth | Place_Of_Birth | ... Read More

How to add string and other data types for Listview in Android?

Jennifer Nicholas

Jennifer Nicholas

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

524 Views

This example demonstrates How to add string and other data types for Listview in Android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/ activity_main.xml. ... Read More

C++ Program to Perform Quick Sort on Large Number of Elements

Jennifer Nicholas

Jennifer Nicholas

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

324 Views

The quicksort technique is done by separating the list into two parts. Initially a pivot element is chosen by partitioning algorithm. The left part of the pivot holds the smaller values than pivot, and right part holds the larger value. After partitioning, each separate lists are partitioned using same procedure.Here ... Read More

How to convert array to arraylist in android?

Jennifer Nicholas

Jennifer Nicholas

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

654 Views

This example demonstrates How to convert array to arraylist in android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.           ... Read More

How to use AVG () in Android sqlite?

Jennifer Nicholas

Jennifer Nicholas

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

150 Views

Before getting into an example, we should know what SQLite database in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built-in SQLite database implementation. SQLite supports all the relational database features. In order to access ... Read More

How to manage startActivityForResult on Android?

Jennifer Nicholas

Jennifer Nicholas

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

850 Views

This example demonstrate about How to manage startActivityForResult on AndroidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above code, ... Read More

Why is it faster to process a sorted array than an unsorted array in C++ program?

Jennifer Nicholas

Jennifer Nicholas

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

111 Views

In C++, it is faster to process a sorted array than an unsorted array because of branch prediction. In computer architecture, a branch prediction determines whether a conditional branch (jump) in the instruction flow of a program is likely to be taken or not.Let’s take an example:if(arr[i] > 50) { ... Read More

C++ Program to Represent Graph Using Incidence Matrix

Jennifer Nicholas

Jennifer Nicholas

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

1K+ Views

The incidence matrix of a graph is another representation of a graph to store into the memory. This matrix is not a square matrix. The order of the incidence matrix is V x E. Where V is the number of vertices and E is the number of edges in the ... Read More

Advertisements