I am also active at:
Thursday, August 27, 2020
Tuesday, August 25, 2020
Monday, August 24, 2020
Sunday, August 23, 2020
Features of an Enterprise Application
What's an enterprise application means and what are its characterstics
How are enterprise built and what are its basic components
Thursday, August 20, 2020
Recursive problems: Example solutions
Problem 1:
'n' number of people are standing in a queue. People standing on even positions are selected. Of the selected people a queue is formed and again out of these only people on even position are selected. This continues until we are left with one person. Find out the position of that person in the original queue.
Solution:
#Python code
#declare a Global variable to store the last base case value of the recursion in it.
h = []
# The recursive function definition
def rec(l):
global h
m = []
#see the list after each recursive call
print(l)
#see the size of the new list after each recursive call
print(len(l))
#base case
if len(l) == 1:
h = l
if len(l)>1:
#Getting the even indexed elements of the list
for i in range(0,len(l)):
if (i+1) %2 == 0:
m = m + [l [i]]
# The above three lines can be replaced by following single line
# m = l[1::2] , this puts all the even indexed elements of list l in m. This also significantly improve #performance. Similarly, we can get odd indexed element with m = l[::2]
rec(m)
return h
# end of the recursive function
n=19
k = list(range(1,n+1))
#Call the recursive function
a = rec(k)
#Convert the only element in the list returned by the recursive function into a string
s = str(a[0])
print("Answer is " + s)
Output:
Problem 2
Print a sequence of numbers starting with a positive number N, recursively, such that A[i+1] = A[i] - 5, as long as A[i]>0. Once A[i] becomes negative, then A[i+1]=A[i] + 5, repeat it until A[i]=N.
Solution:
#Python code
def rec(n):
print(n,end=" " )
if n>0:
n = n - 5
rec(n)
n = n + 5
print(n,end=" ")
# end of recursive function definition
n = int(input("Enter the value of n :"))
rec(n)
Wednesday, August 19, 2020
Kaggle Learn
Learn and practice how to build Machine Learning models for Data Science https://www.kaggle.com/learn/intro-to-machine-learning
Tuesday, August 18, 2020
Web server Vs Application server
Follwing vidoes explans the differences between a web server and application server
- https://www.youtube.com/watch?v=WkaLSZ888as
- https://www.youtube.com/watch?v=ATObcDPLa40
- https://www.youtube.com/watch?v=bgqtxlp7ftc
Monday, August 17, 2020
Saturday, August 15, 2020
Monday, August 10, 2020
How to create an installer for your desktop Java application
You can build an installer (setup file) for your Java app like this creating-an-installer-for-java-desktop-application.
How to build Python executable
Build Python executable from your .py file to run it on Windows without requiring to install Python on your computer py2exe
Saturday, August 8, 2020
Cohen Sutherland Clipping Algorithm
Explanation of clipping algorithm Cohen Sutherland Clipping Algorithms
Friday, August 7, 2020
Object Serialization in Java
This video illustrates the concept of the 'Serializable Interface' and its use Why to implement Serializable interface
Accessing a Java Bean from a JSP file
This video illustrates how to invoke a JavaBean class from inside a JSP file Accessing a Java Bean from JSP
Thursday, August 6, 2020
Java Bean and EJB
What is a Java bean Java Bean Video
The complete playlist on Advanced Java Advanced Java - Java as a Programming Suite
Monday, August 3, 2020
Saturday, August 1, 2020
Program Execution (control flow) in a double recursive call
//Understanding double recursion part 1
#include<stdio.h>
//Global variable
int level = 0;
/*
split a list in two equal halves recursively,
and print the level of the binary tree for each node(function call) value pair.
This is the same function used in the DIVIDE & CONQUER technique (splitting
a list from mid recursive ) of Merge Sort.
*/
void split(int low, int high)
{
level++; //increment the level each step downwards journey of program execution
int mid;
//printf("low = %d High = %d Level = %d\n",low,high,level);
printf("%d %d Level = %d\n",low,high,level);
if(low<high)
{
mid = (low + high)/2;
split(low,mid); //split the left half recursively
split(mid + 1,high); //split the right half recursively
}
level--; //decrement level as retrace each step upwards the tree, of program execution.
}
int main(void)
{
printf("For input 1 and 8\n"); // A list of 8 elements, index starting from 1
split(1,8);
printf("For input 1 and 16\n"); // A list of 16 elements, index starting from 1
split(1,16);
return 0;
}
/*
Understanding double recursion part 2
Making both the recursive calls in the
SAME line (return statement) also produces
the same result.
The only difference now is that you need to pass
the level as the third argument to the function.
*/
#include<stdio.h>
//Global variable
int level = 0;
/*
split a list in two equal halves recursively,
and print the level of the binary tree for each node(function call) value pair.
*/
int split(int low, int high, int height)
{
height++; //increment the level each step down
int mid;
printf("%d %d Level = %d\n",low,high,height);
//base condition
if(low == high)
{
return 1;
}
if(low<high)
{
mid = (low + high)/2;
return split(low,mid,height) + split(mid + 1,high,height);// The recursive calls in the SAME line
}
height--; //decrement level as retrace each step upward
}
int main(void)
{
printf("For input 1 and 8\n");
printf("%d \n",split(1,8,level));
printf("For input 1 and 16\n");
printf("%d \n",split(1,16,level));
return 0;
}
इश्क में ग़ैरत-ए-जज़्बात ने रोने ना दिया - सुदर्शन फ़ाकिर
इश्क में ग़ैरत-ए-जज़्बात ने रोने ना दिया वरना क्या बात थी किस बात ने रोने ना दिया आप कहते थे कि रोने से ना बदलेंगे नसीब उमर भर आप की इस बात...
-
Acronym Full Form AJAX Asynchronous JavaScript and XML API Application Programming Interface APK Android Application Package ASP Activ...
-
#include<stdio.h> int main() { int M,N,q; scanf("%i %i",&M, &N); if((M%N)!=0) {printf("0...
-
"A good company understands that problem solving ability and the ability to learn new things are far more important than knowledge o...