- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

Updated on 30-Jul-2019 22:30:25
Let us first create a tablemysql> create table orderByAFunctionDemo -> ( -> Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, -> FirstNumber int, -> SecodNumber int -> ); Query OK, 0 rows affected (0.44 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into orderByAFunctionDemo(FirstNumber, SecodNumber) values(10, 4); Query OK, 1 row affected (0.11 sec) mysql> insert into orderByAFunctionDemo(FirstNumber, SecodNumber) values(45, 78); Query OK, 1 row affected (0.17 sec) mysql> insert into orderByAFunctionDemo(FirstNumber, SecodNumber) values(23, 10); Query OK, 1 row affected (0.12 sec) mysql> insert into orderByAFunctionDemo(FirstNumber, SecodNumber) values(67, ... Read More 
Updated on 30-Jul-2019 22:30:25
This is a C++ Program to Find Size of the Largest Independent Set (LIS) in a Given a Binary Tree.AlgorithmBegin. Create a structure n to declare data d, a left child pointer l and a right child pointer r. Call a function max() to return maximum between two integers. Create a function LIS() to return the size of the largest independent set in a given binary tree. Calculate size excluding the current node int size_excl = LIS(root->l) + LIS(root->r) Calculate size including the current node int size_incl = 1; if (root->l) ... Read More 
Updated on 30-Jul-2019 22:30:25
This is a C++ Program to implement Network_Flow problem using Ford Fulkerson algorithm.Algorithms:Begin function bfs() returns true if there is path from source s to sink t in the residual graph which indicates additional possible flow in the graph. End Begin function fordfulkarson() return maximum flow in given graph: A) initiate flow as 0. B) If there is an augmenting path from source to sink, add the path to flow. C) Return flow. EndExample Code#include #include #include #include #define n 7 using namespace std; bool bfs(int g[n][n], int s, int ... Read More 
Updated on 30-Jul-2019 22:30:25
Following is the syntax to retrieve the documents whose values end with a particular character in MongoDBdb.yourCollectionName.find({yourFieldName: {$regex: "yourEndingCharacter$"}}).pretty();Let us first create a collection with documents>db.retrieveDocumentsWithEndsWithParticularCharacterDemo.insertOne({"StudentName":"Adam", "StudentAge":25, "StudentCountryName":"LAOS"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9c45b32d66697741252456") } >db.retrieveDocumentsWithEndsWithParticularCharacterDemo.insertOne({"StudentName":"Sam", "StudentAge":24, "StudentCountryName":"ANGOLA"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9c45c02d66697741252457") } >db.retrieveDocumentsWithEndsWithParticularCharacterDemo.insertOne({"StudentName":"Robert", "StudentAge":21, "StudentCountryName":"AUS"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9c45cb2d66697741252458") } >db.retrieveDocumentsWithEndsWithParticularCharacterDemo.insertOne({"StudentName":"Chris", "StudentAge":20, "StudentCountryName":"UK"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9c45d92d66697741252459") } >db.retrieveDocumentsWithEndsWithParticularCharacterDemo.insertOne({"StudentName":"Larry", "StudentAge":23, "StudentCountryName":"US"}); { "acknowledged" : true, "insertedId" : ObjectId("5c9c45eb2d6669774125245a") }Following is the query to display all documents from a collection ... Read More 
Updated on 30-Jul-2019 22:30:25
Let us first create a string array −String[] strArr = new String[] { "r", "p", "v", "y", "s", "q" };Now, use Arrays.sort() to get the subset. Use the following to sort only from the index range 2 to 6.Arrays.sort(strArr, 2, 6);Example Live Demoimport java.util.Arrays; public class Demo { public static void main(String[] args) { String[] strArr = new String[] { "r", "p", "v", "y", "s", "q" }; Arrays.sort(strArr, 2, 6); System.out.println("Sorted subset of array elements from index 2 to 6..."); for (int a = 0; a < strArr.length; ... Read More 
Updated on 30-Jul-2019 22:30:25
In this section we will see what is the compound literals in C. The compound literals are introduced in C99 standard in C. Using this feature, it can create unnamed objects. In the following example we will see how to use compound literal to generate object without any name.Example#include
struct point {
int x;
int y;
};
void display_point(struct point pt) {
printf("(%d,%d)", pt.x, pt.y);
}
main() {
display_point((struct point) {10, 20});
}Output(10,20)
Updated on 30-Jul-2019 22:30:25
Transpose a matrix means we’re turning its columns into its rows. Let’s understand it by an example what if looks like after the transpose.Let’s say you have original matrix something like -x = [[1, 2][3, 4][5, 6]]In above matrix “x” we have two columns, containing 1, 3, 5 and 2, 4, 6.So when we transpose above matrix “x”, the columns becomes the rows. So the transposed version of the matrix above would look something like -x1 = [[1, 3, 5][2, 4, 6]]So the we have another matrix ‘x1’, which is organized differently with different values in different places.Below are couple ... Read More 
Updated on 30-Jul-2019 22:30:25
Driving a car in India is really a challenge. The constant increase in vehicles, small lanes, and uncontrollable traffic conditions is creating a lot of stress when people get on the road with a two wheeler or four wheeler.As a citizen, I want the traffic conditions in India to be improved. I have a few suggestions to the authorities and request them to implement the same.Check speed violations and issue challans immediately.Road encroachments should be arrested and roads should be widened to fit the increasing traffic.Strict laws for auto rickshaws, share autos and maxi-vans should be implemented to avoid illegal ... Read More 
Updated on 30-Jul-2019 22:30:25
The Program and data which are stored in the memory, are used externally to the microprocessor for executing the complete instruction cycle. Thus to execute a complete instruction of the program, the following steps should be performed by the 8085 microprocessor.Fetching the opcode from the memory;Decoding the opcode to identify the specific set of instructions;Fetching the remaining Bytes left for the instruction, if the instruction length is of 2 Bytes or 3 Bytes;Executing the complete instruction procedure.The given steps altogether constitute the complete instruction cycle. These above mentioned steps are described in detail later. The above instructions are assumed by ... Read More 
Updated on 30-Jul-2019 22:30:25
Stooge Sort is used to sort the given data. It is a recursive sorting algorithm. Stooge Sort divides the array into two overlapping parts, 2/3 each and Sort the array in three steps by sorting I then II and again I part. The worst case time complexity of this algorithm is O(n^2.7095).AlgorithmBegin Take input of data. Call StoogeSort() function with ‘a’ the array of data and ‘n’ the number of values, in the argument list. Implement Sorting using recursive approach. Divide the array into first 2/3 element as ... Read More Advertisements