How do you calculate space complexity?
Calculate the amount of additional memory used by the algorithm relative to the number of its inputs. Typically the number of inputs is defined by a container object or data sequence of some type, such as an array. If the amount of memory consumed remains the same regardless of the number of inputs, then the space complexity is constant, denoted O(1) in Big-Omega notation (Big-O). If the amount of memory consumed increases linearly as n increases, then the space complexity is O(n).
For example, the algorithm that sums a data sequence has O(1) space complexity because the number of inputs does not affect the amount of additional memory consumed by the accumulator. However, the algorithm which copies a data sequence of n elements has a space complexity of O(n) because the algorithm must allocate n elements to store the copy.
Other commonly used complexities include O(n*n) to denote quadratic complexity and O(log n) to denote (binary) logarithmic complexity. Combinations of the two are also permitted, such as O(n log n).
Describe the software interrupt with a neat diagram?
What are the defects in a crystal? Describe them with a neat diagram
What is hold and wait condition?
A process or thread holding a resource while waiting to get hold of another resource
Algorithm for addition of two polynomials using linked list?
Let p and q be the two polynomials represented by the linked list. 1. while p and q are not null, repeat step 2. 2. If powers of the two terms ate equal then if the terms do not cancel then insert the sum of the terms into the sum Polynomial Advance p Advance q Else if the power of the first polynomial> power of second Then insert the term from first polynomial into sum polynomial Advance p Else insert the term from second polynomial into sum polynomial Advance q 3. copy the remaining terms from the non empty polynomial into the sum polynomial.
What is big-o notation for describing time complexity of algorithm?
Big O notation allows to specify the complexity of an algorithm in a simple formula, by dismissing lower-order variables and constant factors.
For example, one might say that a sorting algorithm has O(n * lg(n)) complexity, where n is the number of items to sort.
Big O notation is used in Computer Science to describe the performance or complexity of an algorithm. Big O specifically describes the worst-case scenario, and can be used to describe the execution time required or the space used (e.g. in memory or on disk) by an algorithm.
George H. Mealy presented the concept of a finite-state machine that became known as the Mealy machine in a 1955 paper, "A Method for Synthesizing Sequential Circuits." This machine differs from a Moore machine in that rather than the outputs being defined by the current state, the outputs are defined by both the current state and the current inputs.
What is the sum of 20 and -4 divided by the product of 4 and -2?
The sum of 20 and -4 is +16, while the product of 4 and -2 is -8. The answer to the question is therefore -2.
Computer Awareness is been aware of how a computer looks and functions. This doesn't mean just what programmes you can load onto a computer but also the parts that makes up a computer on the inside.
C programming is called middle level language?
(i) it gives or behaves as High Level Language through Functions - gives a modular programming and breakup, increased efficiency for reusability
(ii)it gives access to the low level memory through Pointers. Moreover it does support the Low Level programming i.e, Assembly Language.
As its a combination of these two aspects, its neither a High Level nor a Low level language but a Middle Level Language.
Of note: C++ supports pointers and some basic assembly aspects. It is, however, high-level. C is 3rd generation, not due to pointers or functions, as most languages after the 1st generation include some implementation of these, but because it introduced the first (relatively speaking) aspects of object orientation (structs and enums). C++ carried on with this, leading to the "4th", which has become too varried to refer to as such. There is no such thing as a middle-level language. Machine code to BASIC to C to C++ and Java and such, C is definitively on the higher end of the programming specture.
What are the c-programs for file allocation techniques?
// Indexed Allocation
#include
#include
#include
struct node {
int file_name;
int data;
int is_free;
int size;
int directory;
int cnt;
struct node* link;
struct node* inner_link[30];
};
struct node* defaultFile() {
struct node* temp = (struct node*)malloc( sizeof(struct node) );
temp->link = NULL;
temp->is_free=0;
temp->data='a';
temp->file_name=99;
temp->directory = 1;
return temp;
}
struct node* insert(struct node *rt, int size, int fname) {
struct node* temp = rt;
struct node* first=NULL,*last=NULL,*tt=NULL;
int flag=0,act_size=0, inner_fname=100,cnt=0;
last=first;
act_size = size;
if ( size>temp->size ) {
printf("There is not enough space on the disk to write that file\n");
return rt;
}
while( temp->link ) {
temp = temp->link;
}
first = defaultFile();
while( act_size>0 ) {
tt = defaultFile();
if (act_size>50)
tt->size = 50;
else
tt->size = act_size;
tt->file_name = inner_fname;
first->inner_link[cnt] = tt;
tt->directory = 0;
tt->is_free = 0;
act_size -= 50;
inner_fname += 1;
cnt += 1;
}
temp->link = first;
first->is_free = 1;
first->cnt = cnt;
first->size = size;
first->file_name = fname;
act_size = rt->size;
rt->size = act_size-size;
return rt;
}
void printFiles(struct node* rt) {
struct node *temp = rt, *tt;
int first=0,cnt=0;
printf("format is (File name, size)\n");
printf("\t(%d,%d)\n",rt->file_name,rt->size);
while( temp ) {
if ( temp->is_free ) {
printf("\t(%d,%d)\n",temp->file_name,temp->size);
first = 0;
while( cntcnt ) {
tt = temp->inner_link[cnt];
printf("\t\t(%d,%d)\n",tt->file_name, tt->size);
cnt += 1;
}
printf("\n");
}
temp = temp->link;
}
}
struct node* combine(struct node *rt,int fname) {
struct node *temp=rt,*nt=NULL,*temp1=temp->link;
int size=0;
if ( rt->file_name==fname ){
printf("You cannot that file as thats just to show that that much amount of space is left in the disk\n");
return rt;
}
while( temp1 ) {
if (temp1->is_free==0 && temp1->file_name==fname ) {
size = temp1->size;
temp->link = temp1->link;
temp1 = temp->link;
}
else {
temp = temp1;
temp1 = temp1->link;
}
}
rt->size += size;
return rt;
}
struct node* deleteFiles(struct node* rt, int fname) {
struct node *temp = rt,*nt=NULL;
int flag=0;
while( temp && flag==0 ) {
if (temp->file_name==fname) {
temp->is_free=0;
flag=1;
}
temp = temp->link;
}
if( flag==0 ){
printf("There doesnt exist any file with that name\n");
}
return combine(rt,fname);
}
int main() {
int flag,no,size,data;
struct node *root;
root = defaultFile();
root->size=1000;
data=100;
flag=no=size=0;
while( flag==0 ) {
printf("Enter no's \n1.insert\n 2.Delete\n 3.Print files \n 4.Exit\n");
scanf("%d",&no);
printf(" no is %d\n",no);
switch(no) {
case 1:
printf("Enter file size\n");
scanf("%d",&size);
root = insert(root, size, data);
data = data+1;
break;
case 2:
printf("Enter file name to delete\n");
scanf("%d",&size);
root = deleteFiles(root, size);
break;
case 3:
printFiles(root);
break;
case 4:
flag=1;
printf("Quitting from loop\n");
break;
default:
printf("Enter a valud no \n");
break;
}
}
}
What is token in computer programming?
In a passage of text, individual words and punctuaton marks are called tokens.the smallest individual unit in a prog is called a token..
Which are the different tools in Adobe photoshop and how we can use it to create a design?
There are many tools you can use to create design, Type Tool to create text, Shape Tools to draw shapes, Pen Tool to draw shapes, Brush Tool to paint and they are located on left side of Screen in Toolbox.
How do you get to become a certified system administrator?
You have to pass the ADM201 exam.
This examination cost $200 and you can register through webassessor.com
Passing it though is not that easy, although all questions are covered in the help and training of Salesforce which is available free in their website, most aspirants still have to enroll a $3000 course on Administration Essentials - yet, not all of them always pass.
You have to review a lot on your own. See sources below.
Write down the algorithm to delete a node from doubly linked list whose data item is given?
1. Find the element is the list. Let pointer 'p' point to it.
2. Delete it from the list:
if (p->Prev) p->Prev->Next = p->Next;
else List->First = p->Next;
if (p->Next) p->Next->Prev = p->Prev;
else List->Last = p->Prev;
3. Release the memory associated with it.
You get a screen recorder and 3 other high levels and record you simming once and it does it over and over
Algorithm to find whether a number is prime or not?
check if 2 divides the Number
check if 3 divides the Number
check if 5 divides the Number
...
check if any prime numbers less than the square root of the Number divide the Number
If any do, the Number is composite; otherwise the Number is prime.
This is called the Sieve of Erasthenes.
An easy way to check if a prime number divides the Number in base ten (if you don't have a calculator) is to add or subtract 1 or 3 times the prime number to the Number, so that the sum or difference is a multiple of ten (if the prime number isn't 2 or 5). Knock off the zero. If the prime number divides the new number, it also divides the Number; otherwise it doesn't.
How many 8 bit characters does the ASCII standard define?
128 (0-127), 95 printable, 33 control (for 7 bit ascii that is a through back to teletypes.)
ISO 8859-1 has 256 characters.
From 128 up to 255 we find extra symbols for other languages and regions. Ascci 128 = € for instance and 255 = ÿ.
Of course there are many 8-bit standars, windows-1250, for an example.
What is computer application in science and technology?
Computer science (or computing science) is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems.. Computer Science is frequently described as the systematic study of algorithmic processes that describe and transform information; the fundamental question underlying computer science is, 'What can be (efficiently) automated?. Computer science has many sub-fields; some, such as computer graphics, emphasize the computation of specific results, while others, such as computational complexity theory, study the properties of computational problems. Still others focus on the challenges in implementing computations. For example, programming language theory studies approaches to describing computations, while computer programming applies specific programming languages to solve specific computational problems, and human-computer interaction, focuses on the challenges in making computers and computations useful, usable and universally accessible to people. The general public sometimes confuses computer science with other vocational areas that deal with computers, such as information technology (IT), or think that it relates to their own experience of computers, which typically involves activities such as gaming, web-browsing, and word-processing. However, the focus of computer science is more on understanding the properties of the programs used to implement software such as games and web-browsers, and using that understanding to create new programs or improve existing ones.
How are colons and semicolons used in computer science?
In Excel, for example, if you write (A3,A8), the computer only takes cells A3 and A8, whereas if you write (A3;A8), it takes every cell between A3 and A8 (A3, A4, A5, A6, A7, A8).
6 Can a program be correct and still not be reliable?
Im not sure what your asking, but I think what your trying to say here is like Microsoft word for instance, has a spelling and grammar check feature. You write your article, leave all the mistakes in, hit F7 and all your problems are solved. Not really. If for example you spell though but you meants thought, those are both real words. Microsoft word wouldn't pick that up.
How much time does a full time college student spend in class?
For colleges and universities that operate on a regular semester system, one credit requires 16 hours of class contact time for the semester. Thus, a three credit course means 48 hours of class contact time for the semester. The minimum full-time student load is 12 credits. This equates to 12 hours of class contact time per week, and totals 192 hours of class contact time for the semester.
What is Conventional animation?
Conventional animation is without the benefit of CGI graphics and utilises traditional animation using hand-drawn cels .