1.pag-unawang literal
2.pag-unawang ganap sa mga kaisipan ng may akda lakip ang mga karagdagang kahulugaan
3.pagkilatis sa kahalagahan ng mga kaisipan at ng kabisaan ng paglalahad
4.pagsanib ng mga kaisipang nabasa at ng mga karanasan upang magdulot ng bagong pananaw at pagkaunawa.
5.paglikha ng sariling kaisipang ayon sa mga kasanayan at kawilihan sa binasang seleksyon.
from:pabuhat feil James
What is the main idea of artificial intelligence?
We use Artificial Intelligence, or, AI, for multiple reasons. If we can find out more of AI, we could make a machine that could help us better in science and benefit the world.
Why should main be declared static and is declaring it public and void not sufficient?
The static modifier means that it does not have to be instantiated to use it. Before a program runs there are technically no objects created yet, so the main method, which is the entry point for the application must be labeled static to tell the JVM that the method can be used without having first to create an instance of that class. Otherwise, it is the "Which came first, the chicken or the egg?" phenomenon. Your main method should be declared as follows: public static void main (String[] args) { lots of your java code... } As we know, java is a pure OOP , that means everything should be in the class, main. Aso, because main is itself a function, static member functions should not refer to objects of that class. But we can access static functions through classname itself, as: class TestMain { public static void main(String args[]) { body; } } Now, cmd>javac TestMain.java cmd>java TestMain as we know the static member functions has to call through its class name. That's why the programme name must be same as the class name ,where we wrote the main function. Another important point is : static variables or member functions will load during class. That means before creating any instances(objects), the main function is the first runnable function of any program which we run manually, such as : cmd>java TestMain(run) if , any sharing information.
Advantages of binary search over sequencial search?
Linear search takes linear time with a worst case of O(n) for n items, and an average of O(n/2). Binary search takes logarithmic time, with a worst and average case of O(n log n). Binary search is therefore faster on average.
Which module in a typical program will execute the most times?
There is no such thing as a typical execution environment let alone a typical executable, so it is impossible to say. However, there are a finite number of core operating system modules that are common to all platforms of the same type, so it is highly likely that one of these will be the most-executed upon those specific configurations.
What is high level disinfection?
High level disinfection is when something is disinfected very well where there are no germs left.
What is the relationship between a programming language and machine code?
About the relationship between engineering / architecture and plumbing in building houses.
Computer Science looks at how one figures out how to develop algorithms and methods of solving a problem. Computer Programming is the implementation in software code of the algorithm.
Write a C Program to draw concentric circles using mid-point algorithm?
#include
#include
#include
void main()
{
int gd=DETECT,gm=4,i;
initgraph(&gd,&gm,"c:\\tc\\bgi");
setcolor(3);
for(i=0;i<150;i+=5)
{
circle(300,300,i);
}
getch();
}
What is binary 11111111 equal to as a decimal?
11111111 = 255 in standard binary. think of it like so: 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 1 1 1 1 1 1 1 1
in other words, (1x128) + (1x64) etc. etc. In Signed Binary however, this would equal -127 since in signed binary, the first bit represents the sign for plus or minus. e.g 0 = +, 1 = -. as such: Plus or minus | 64 | 32 | 16 | 8 | 4 | 2 | 1 1 (-) 1 1 1 1 1 1 1
How to convert 2D array to single dimensional array?
You don't need to physically convert the array, you simply need to point at the first element and read the elements sequentially. The following code shows how to achieve this, as well as how to physically convert a 2D array to a separate 1D array. As can be seen, there is no practical benefit to making the conversion.
Example
#include
int main()
{
const int rows = 2;
const int cols = 3;
const int size = rows * cols;
// Create a static 2D array, intialise and print the matrix
int arr2[rows][cols];
std::cout << "2D array:\n" << std::endl;
for( int r=0; r { for( int c=0; c { arr2[r][c]= (r+1) * (c+1); std::cout << arr2[r][c] << " "; } std::cout << std::endl; } std::cout << std::endl; // Efficient conversion to 1D array: // Point to the first element then print sequential values. int* ptr = (int*) arr2; std::cout << "1D array (using pointer):\n" << std::endl; for( int i=0; i std::cout << *ptr++ << " "; std::cout << "\n" << std::endl; // Inefficient conversion to 1D array: // Copy the 2D array to a separate 1D array int arr1[size]; ptr = (int*) arr2; for( int i=0; i arr1[i]=*ptr++; // Print the copy: std::cout << "1D array (using copy):\n" << std::endl; for( int i=0; i std::cout << arr1[i] << " "; std::cout << "\n" << std::endl; return( 0 ); } Output 2D array: 1 2 3 2 4 6 1D array (using pointer): 1 2 3 2 4 6 1D array (using copy): 1 2 3 2 4 6
Why you use if and else statement in c language program?
There is no "elseif" statement in C. You can only use "else" and "if" separately. This is a good reason for switch/case/break.
Multithreaded program generates Fibonacci series using java-answer?
The formula for the Fibonacci series is
Fn = Fn-1 + Fn-2 for n ≥ 2 with F0 = 0 and F1 = 1.
In layman's terms, in the Fibonacci series each successive number is the sum of the previous two numbers, starting with 1. So we have 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55 etc
To do this in Java or any computer program you will need to create a recursive program, one that picks up previous values. This is quite easy, even for a beginner, once one grasps the Fibonacci fundamentals. Here is an example in Java:
public class Fibonacci {
public static long fib(int n) {
if (n <= 1) return n;
else return fib(n-1) + fib(n-2);
}
public static void main(String[] args) {
int N = Integer.parseInt(args[0]);
for (int i = 1; i <= N; i++)
System.out.println(i + ": " + fib(i));
}
}
For n, enter the number of values required, otherwise the increasing values of the results will overflow the parameters of the data display!
This code can be adapted for any progamming language, e.g. pascal, basic etc. One can even use the principles to construct a spreadsheet that will show the Fibonacci series in successive rows in Excel, for example.
void main()
{char a[30] = "India";
//Let the string be stored in a[30];
char b[30]; //declaring another string
for(i=0;i<strlen(a);i++)
{b[strlen(a)-1 - i]=a[i];}
//Now reverse string is stored in b;
//to print it
cout<<b;
getch();
}
Where does the main function return the value in C programming language?
To fulfill the purpose I don't use return but use a different method. pass by references:
#include<stdio.h>
void myFunc(int n[]){
int i;
for(i = 0; i<10; i++)
n[i] = i;
}
int main(void){
int a[10];
int i;
myFunc(a);
for(i=0; i<10; i++){
printf("%d\n",a[i]);
}
}
How do you find greatest factor of a number which is a factorial number in c language?
#include<stdio.h> #include<conio.h> main() { int f=1,i=1,n; clrscr(); printf("\n Enter factorial value"); scanf("%d",&n); for(;i<=n;i++) { f=f*i; } printf("\n The factorial value=%d",f); getch(); }
Which type of protocol is useful when data must be transferred fast?
connectionless protocols. A connection less protocol's lack of sophistication makes it more efficient than a connection-oriented protocol and renders it useful in situations in which data must be transferred quickly
Why is Java not a pure OOP Language?
Java is a OOP language and it is not a pure Object Based Programming Language.
Many languages are Object Oriented. There are seven qualities to be satisfied for a programming language to be pure Object Oriented. They are:
Java is not because it supports Primitive datatype such as int, byte, long... etc, to be used, which are not objects.
Contrast with a pure OOP language like Smalltalk, where there are no primitive types, and boolean, int and methods are all objects.
When the constructor is called how many times will it be copied?
constructor is called every times when we create object of class using new keyword
and constructor can not be copied (vinayak shendre)
What giant bird captured the famous Sinbad the Sailor?
Sinbad the Sailor encounters Roc eggs on his fifth voyage. His crew has a meal of the chick inside, only to then be shipwrecked by an angry parent Rocs who throw boulders at the ship.
What is devising of algorithms?
The algorithm is designed through algorithm engineering. The Algorithm design refers to one of the specific methods that is used in creating the mathematical process that is used in problem solving.
Which is the best object oriented programming language for beginners?
I would go with Python.
Python is therefore an ideal backend language due to its simplicity and consistency, where the developers are able to write reliable systems with a vast set of libraries belonging to Machine Learning, Keras, TensorFlow and Scikit-learn
Comparison between array and dynamic implementation of linked list?
I assume you are referring to implementation of Abstract Data Types like Stacks and Queues.
Arrays have capacity limits which you set upon declaring them. If you have date which has a definite size, then using arrays is okay.
But if you have data which size changes at runtime, then just use linked lists because linked lists could constantly add nodes whenever needed.
arrays need continuous memory allocation for their creation but in linked list the memory allocation need not be continuous....
What are the disadvantages of computers on human health?
the disadvantage of computer in human health is.............................cancer
A simple Binary Search Algorithm is as follows:
Calculate the mid element of the collection.
Compare the key items with the mid element.
If key = middle element, then we return the mid index position for the key found.
Else If key > mid element, then the key lies in the right half of the collection. Thus repeat steps 1 to 3 on the lower (right) half of the collection.
Else key < mid element, then the key is in the upper half of the collection. Hence you need to repeat the binary search in the upper half.
for get program copy link ( babaplayer.blogspot .com/2021/07/binary-search-using-divide-and-conquer.html )