What is the criteria of algorithm analysis?
The term "analysis of algorithms" was coined by Donald Knuth. Algorithm analysis is an important part of a broader computational complexity theory, which provides theoretical estimates for the resources needed by any algorithm which solves a given computational problem.
1
Is it true or false that a dynamically linked list can be accessed both sequentially and randomly?
No. Linked lists require traversal, and are therefore accessed sequentially. For random access you need an array. An array of pointers to the data in your list would do, but you will incur an overhead in creating the array on top of the list.
I presume you are asking for an example of a Brief command prompt? First go to a CMD shell by selecting the windows button in the bottom left corner and typing CMD after "RUN". A black screen will appear where you can enter any prompt such as: ipconfig - IP confirguration
Dir - directory listing
How do you change the language in your computer?
Write a java program to print the last digit in Fibonacci series?
Just generate the Fibonacci numbers one by one, and print each number's last digit ie number%10.
Functions of a linker in system software?
A linker takes the object files produced by the compiler and links them together to form a single machine code executable.
What are the advantages of functionalism?
Functionalism is defined as the theory that all aspects of a society serve a function and are necessary for the survival of that society, the theory that mental states can be sufficiently defined by their cause, their effect on other mental states, and their effect on behavior. The advantages are a reassurance of our values, boundary formation, social change, and social affirmation.
What is the function of windows in GUI?
Where the user interacts with a program. Information shows in these windows and multiple windows can be started at the same time. Every application has to be opening in a window.
Why do more programmers prefer to write programs using high level language than low level language?
A high level language like Java is easier for programmers (Us) to understand. The machine language will be in binary & byte codes which is very difficult for the normal man to decipher and understand. Hence we prefer writing the code in HLL and then have a compiler or interpreter convert it into machine language for the machine to understand.
When should a for loop be used instead of a while loop?
The golden rule in iteration: everything done with a for loop can be done with a while loop, BUT not all while loops can be implemented with a for loop. for-loops are just a short-cut way for writing a while loop, while an initialization statement, control statement (when to stop), and a iteration statement (what to do with the controlling factor after each iteration). = Examples of for-loops = The most basic use for using for-loops is to do something a set number of times: for(int k = 0; k < 10; k++); // this loops runs for 10 times another less common use of the for-loop is traversing raw listNodes, since it does contain an initialization(finding the first node), control (as long as there is a next node), and a iteration statement (get my next node). i.e.: for(ListNode temp = startingNode; temp != null; temp = temp.getNext); // this traverses the entire ListNode list and stops when it has exhausted the list = How to implement for-loops using while loop = Basically for loops are just short hand for while loops, any for loop can be converted from: for([initialize]; [control statement]; [iteration]); to [initialize]; while([control statement]) { //Do something [iteration]; } These two does the exact same thing. = For When Only while Loop can be used = while-loops are used when the exiting condition has nothing to do with the number of loops or a controll variable, maybe you just want to keep prompting the user for an input until the given input is valid, like the following example which demands a positive number: int x = [grab input]; while(x < 0) { // Do code
x = [grab input];
} It is true that, when used as intended, a for loop cannot do everything a while loop can, however, in reality, for loops are just as versatile. For example, the above while loop can easily be rewritten to be a for loop as so:
for(int x = [grab input]; x < 0; x = [grab input]){
// Do Code
}
The above for loop behaves exactly like the while loop in the previous heading. A better example of a while loop that should not be a for loop might be:
while(true){
// Do some processing
// Check some condition. If condition is met, break out of loop.
// Do some more processing.
}
Here, the checking of the condition comes in the middle of the processing for the while loop, whereas the condition checked in a for loop is always done at the beginning of the loop. Also, the "iteration" statement is non-existant and is a factor of processing done somewhere else in the while loop. Finally, there was no initialization for this while loop. However, this while loop can still be written as a for loop:
for(;true;){
// Do some processing
// Check some condition. If condition is met, break out of loop.
// Do some more processing.
}
As you can see, a for loop is exactly like a while loop if you leave out the initialization and iteration sections (you still needs the semicolons, to signify those parts of the for loop are still there, they just do nothing). However, it is clear that when you do not need the extra portions of the for loop, why not just use a while loop?
The basic for loop was extended in Java 5 to make iterating over arrays and other collections more convenient. See this website for further explanation:
(http://www.leepoint.net/notes-java/flow/loops/foreach.html)
What is the difference between arrayList and vector in java?
1)Synchronization: Vector is synchronized and arraylist are not. 2)Increment size: Vector can increment the size by double,arraylist can increment it by 50%.
2)The default size of vector has 10, arraylist have 0.
3)we can specify the increment size with the vector and with arraylist we can't.
4)Arraylist is very fast as it is non-synchronized.
What is the difference between a programming language and an Application Programming Interface?
By what I think you asked yes but I can't give you a definite answer because your question does not make sense.
By what I can gather I think you accidently put that is after language.
Application-oriented languages are specialized languages which may be specified and implemented based on general-purpose languages and their implementations. The model used to introduce the specialized languages is based on translation. A simple model supports modifications and extensions of the general language only. An alternative model has an initial phase for defining a semantic basis for the specialized language in the form of a set of abstractions to model the concepts and notions of the application area. The use of specialized languages can be seen as an abstraction process, where several levels of languages (or language parts) are defined.
What is the Space complexity of insertion sort algorithm?
Insertion sort splits a data sequence in two; a sorted portion at the beginning of the sequence followed by an unsorted sequence. Initially, the sorted sequence has just one element because a sequence of 1 can always be regarded as being sorted. We then take the first unsorted element and insert it in its proper place within the sorted sequence. This is achieved by removing it from the sequence (creating a gap in the sequence). We then look at the element to the left of the gap. If it is larger than the element we removed we move the element one position to the right, effectively moving the gap one position to the left. We repeat the process until the element to the left of the gap is smaller or equal to the removed element, or we reach the start of the sequence. We then insert the removed element into the gap, increasing the sorted set by 1 element and reducing the unsorted set by 1 element. We repeat the process until the unsorted set is empty.
The best case for insertion sort is O(n) time because we need to make at least one complete pass over the set. The best case occurs when the set is already sorted and therefore incurs no moves, but we still have to make a single pass over the set to confirm this. In reality, the complexity is O(n-1) because the first element is known to be sorted, however we can ignore minor differences like -1. Moreover, we have to move n-1 elements out of the set and back in again in the same place, but these two operations occur whether an element moves or not, so we can discount it.
The worst case occurs when the set is in reverse order. However, if we count the number of moves in the worst case we find there are k moves on the kth pass, where k<n. Thus for a set of 10 elements, there are 1+2+3+4+5+6+7+8+9 moves in the worst case, which is 45 (a triangular number). Unfortunately, there is no simple notation for triangular numbers, but time complexities are merely intended to give us an indication of performance. We can clearly see that to move n elements we need to make n passes, thus the worst case time-complexity can be denoted as O(n*n).
What is the difference between a physical object and a virtual object?
uhm, i think that the difference is that a virtual object is on the computer or on a screen like a television or a movie screen. and that the standard obejct is osmthing that the human can touch like a computer keyborad, some food, dirt, water, etc etc etc,
Write a program in pascal that calculates the area of a circle?
{Area s the area of cube}
{Length is the length of one side of the cube}
program AreaofCube;
var Area,Length:real;
begin
write('Enter the length of cube: ');
readln(Length);
Area:=6*(Length*Length);
writeln('The area of cube is ', Area, ' cm^2.');
end.
When was computer programming invented?
the Analytical Engine - an engine created by Ada Byron (the Lady Lovelace) and a person named Babbage - Ada suggested to Babbage writing a plan for how the engine might calculate Bernoulli numbers. This plan, is now regarded as the first "computer program."
A software language developed by the U.S. Department of Defense was named "Ada" in her honor in 1979
Usually one element at a time. If you want to process all elements of an array, you write a loop.
Usually one element at a time. If you want to process all elements of an array, you write a loop.
Usually one element at a time. If you want to process all elements of an array, you write a loop.
Usually one element at a time. If you want to process all elements of an array, you write a loop.
Write a code to implement the insertion sort?
#include<stdio.h>
#include<conio.h>
void main()
{
int a[5]={5,2,8,9,4};
int i, k,temp;
for(i=0;i<5;i++)
{
for(k=i+1;k<5;k++)
{
if(a[i]>a[k])
{
temp=a[i];
a[i]=a[k];
a[k]=temp;
}
}
}
printf("\n sorted list=");
for(k=o;k<5;k++)
printf("%d",a[k]);
}
What are the major branches of artificial intelligence?
Over the years of AI development - The branches including AI as its foundation have bloated a lot but to name 5 of them:
The place in a spreadsheet where a row and a column intersect is called a?
A cell. In the periodic table an element fills that cell.
Why machine assembly languages are called low level languages?
Machine Language is the lowest level language other than microcode as it is what the processor itself uses to handle operations. Assembly is low level as it is very close to machine language. Higher level languages have higher levels of abstraction and more structure to them, such as C++. Lower level languages are very operation based.
print means print, f means formatting
or
printf is a output statement function in the C run-time library
example:
printf ("the value of A is %d\n", A);