Relationship between sociology and computer science?
qué relacion existe entre la fisica y la informática?
What does sap stand for in payroll?
System Application and Products in Data processing. It's an ERP Software.
What is Size of int variable in c?
The size of an int variable in c is a function of the compiler implementation. It is usually a word in the underlying computer architecture. Original Microsoft C/C++ compilers for the 16 bit platform defined an int as 2 bytes. Current compilers for the 32 bit platform define an int as 4 bytes. The current ANSI C standard provides that an int is at least 4 bytes, but it could be higher, say 8 bytes on a 64 bit platform.
This is a question I asked myself when I was studying algorithms.
Algorithms are important because of how crucial they are to so many real world applications. Just a few examples are web searching, file sharing, file systems, compilers. Getting a computer science job without knowing anything about algorithms would severely limit you, probably would only be able to find a GUI programming job.
Almost all big companies like Microsoft, Google, Yahoo and Amazon use algorithms in their software and look for engineers who understand them very well. Having a very strong grasp of algorithms in a job interview would set you apart from all others who only simply know how to program.
Basically you need to study algorithms because they are used all the time in complex software projects.
In short you want job then learn algorithm.
What are the four phases of computer data processing?
Identify the problem. Develop a solution. Implement the solution. Monitor the results.
Answerinputprocess
output
What is the purpose of an assignment statement?
An assignment statement sets the value of a named object. This can be used to initialise the object's value or to change the object's value. The object may be a constant or variable, however you can only initialise a constant, not change it.
int i = 42; // Assigns the value 42 to the integer variable named i.
i = 0; // Replaces the value 42 with the value 0.
const double pi = 3.14; // Assigns the value 3.14 to the constant named pi.
pi = 3.14159; // Compiler error; pi is constant!
Why use multiple processes instead of multiple threads?
You use a process when you want a separate program, and a thread when you want to asynchronously execute some different code contained within the same program.
A process is an address space containing instructions, data, stack, etc. It represents one load module (or program) loaded into memory, ususally by the operating system's exec or equivalant call.
There can be more than one process loaded from the same load module. They are separate and distinct, even though they might share regions of instructions and constant data. As an example, the execution of ksh (in linux) or cmd (in windows) represents a process.
While executing, a process can invoke another process, either a copy of itself or a different one. For example, ksh can invoke ls, and cmd can invoke explorer. Keep in mind that this is still a different address space. In the case of linux, the process actually makes a copy of itself (fork) and then overlays itself with the new load module.
A thread, on the other hand is an execution path through a process. Every process has at least one thread, which starts with the first instruction it executes after being loaded, and ends with the call to the exit or equivalent operating system call.
So, to clarify, what executes is actually called a thread, and the process is just the address space. Different naming conventions do exist - this is the windows (and some other OS's) convention.
{Restating from three paragraphs before} While executing, a thread can load another process, either a copy of its containing process or a different one, or it can invoke a new thread within itself. While the difference might seem slight, it is not, because the (now two) threads share the same address space, and they can easily communicate with each other, assuming appropriate synchronization is used.
In the case of linux, you could say that a separate process is started as fork followed by overlay, while a new thread started as fork without the overlay.
Each thread has its own copy of its local variables, and a copy of the invoking parameters. In the simple case, that is sufficient. In the more complex case, involving explicitly allocated heap memory, either different heaps are used, or a mechanism for synchronized sharing is implemented.
What is an uninitialized pointer?
It means "nothing", there is no data provided at all; just an empty value.
Contrary to the previous edit it does not mean "zero", "none" or "blank"; as zero is a number and none and blank can be regarded as data.
#include <iostream> void main() { using namespace std; int num, rem, sum=0; //Declaring variables cout<<"Enter a number :"<<endl; cin>>num; //Loop to calculate the sum of the digits of the given number. while(num!=0) { rem=num%10; num=num/10; sum=sum+rem; } cout<<"Sum of the digits is "<<sum<<endl; cin.get(); }
What are advantages and disadvantages of contiguous memory allocation?
The advantage of contiguous memory allocation is
1. It supports fast sequential and direct access
2. It provides a good performance
3. the number of disk seek required is minimal
The disadvantage of contiguous memory allocation is fragmentation.
In software, an encoder takes some data and transforms it into a format suitable for storage or transmission.
In hardware, an encoder which takes multiple input lines and outputs the binary representation of the single input line which is set to high. Since it is difficult to guarantee that only a single input line will be high at the same time, a priority encoder is generally used instead.
Difference bw linear and nonlinear data structure?
A data strucutre is classified into two categories: Linear and Non-Linear data strcutures. A data structure is said to be linear if the elements form a sequence, for example Array, Linked list, queue etc. Elements in a nonlinear data structure do not form a sequence, for example Tree, Hash tree, Binary tree,etc. There are two ways of represneting linear data strucutresin memory.One way is to have the linear relationship betweent he elements by means of sequential memory locations. Such linear strucutres are called arrays. The other way is to have the linear relationship betweent he elements represnted by means of links.Such linear data strucutres are callled linked list.
There are three forms of loop commonly used in C/C++, the for loop, the while loop
and the do-while loop.
The for loop is most commonly used whenever an action is going to be performed a set amount of times. For example, to sum every element in an array:
for(i = 0; i < arraySize; i++)
{
sum = sum + array[i];
}
The while loop and do-while loop are commonly used to loop until a condition is met. The difference between the two is that the do-while loop goes through one iteration before checking its condition, while the while loop checks its condition before any execution of the loop.
Example do-while loop:
do
{
randomNumber = rand() % 10;
}while(randomNumber != 6);
Example while loop:
cout > number;
while(number < 0)
{
cout > number;
}
What makes the binary system so applicable to computer circuits?
Binary is the simplest way to implement operations and information in a computer system.
However, It is not the only way.
But because of the nature and simplicity to switch electricity on and off it is a natural for computers.
Computers speak only one language which is composed of two sylables, namely "on" and "off". This is just like your light switch on the wall.
Computers are made up of millions of switches. This complexity allows logic functions, similar to human thought, to be performed.
This manifests as a very impressive operation only because a computer operates at such fast speeds.
How you pass array elements to a function?
Passing array elements to a function is achieved by passing the individual elements by reference or by value, just as you would any other variable. However, passing the entire array requires that you pass a pointer-to-pointer to the array along with the dimension(s) of the array.
Importance of virtual functions?
Private virtual functions are useful when you expect a particular method to be overridden, but do not wish the override to be called from outside of the base class. That is, the base class implementation and its overrides remain private to the base class.
Private virtual methods are particularly useful in implementing template method patterns, where certain algorithmic steps need to be deferred to subclasses, but where those steps need not be exposed to those subclasses. In many cases the private virtual methods will be declared pure-virtual, thus rendering the base class an abstract base class.
Write a program to exchange the value of two variables?
#include<stdio.h>
void main()
{
int a,b,t;
printf("enter the values of two varaible");
scanf("%d%d",&a,&b);
t=a;
a=b;
b=t;
printf("the exchanged values are",b,a);
}
What are the applications for circular linked lists?
A singly-linked circular list is useful for implementing queue data structures with minimum overhead. Normally we implement a queue with two pointers: one to the tail for insertions and one to the head for extractions. With a circular list we only need to maintain a single pointer to the tail because the tail always points "forwards" to the head (instead of null as it normally would), thus achieving constant-time access to both the head and tail via a single pointer.
Circular linked lists are generally useful wherever "wraparound" is necessary. That is, from any given node in the list, we can traverse forwards with the guarantee that we will eventually arrive back at that same node. With doubly-linked circular lists we have the advantage of traversing in either direction (bi-directional traversal).
What kind of drawing is 3D drawing?
A 3D drawing is when you use shadows and a sense of depth to create space. making the drawing more convincing and ugly.just kidding more real i meant.
What happens if recursion function is declared inline?
An inline function replaces the call to the function by the body of the function, thus reducing the overhead of saving the context in stack. This is good for functions which are small in size and called occasionally. A recursive function calls an instance of itself and thus can be a deeply nested. Different compilers handle this differently. Some will inline it up to a certain depth and then call a non-inlined instance for further recursion; others will not inline the function at all and generate a normal function call.
Why multidimensional array element access using indirection operator?
The number of dimensions is immaterial. All arrays are implemented as a one dimensional array. A multidimensional array is simply an array where every element is itself an array.
The only thing actually known about any array is that its name is a reference to the start address. Unlike an ordinary (non-array) variable, the elements in the array do not have names, we can only refer to them by their memory offsets from the start of the array. As such, in order to obtain the values stored at those offsets, we must dereference them. While the subscript operator gives us notational convenience, it's easy to forget that there's actually pointer arithmetic and dereferencing going on behind the scenes.
What are good books to use to start programming in python if i don't know how to program?
Your best bet as a beginner would be to try Al Sweigart's Invent Your Own Computer Games With Python. It is aimed at beginners, and is written to be easily understandable for people with zero programming experience. It is available for free from his website. (see related link)
The website includes links to other python resources, which are also worth checking out. Once you have gained a little experience in python, you may want to expand your knowledge by working your way through some other python books. The best commercially available book on python that I have come across is Programming in Python 3: A Complete Introduction to the Python Language, by Mark Summerfield.
What are the two methods of representing a binary tree?
Two method of representing a binary tree is
Static allocation, and
Dynamic allocation
What is the difference between looping statements - c program?
Repetition.
For example the following lines do the same thing:
while (expression) statement;
LABEL: if (expression) {statement; goto LABEL; }
Or these: for (exp1; exp2; exp3) statement;
exp1; LABEL: if (exp2) {statement; exp3; goto LABEL; }
Dijkstra's algorithm is used by the OSPF and the IS-IS routing protocols. The last three letters in OSPF (SPF) mean "shortest path first", which is an alternative name for Dijkstra's algorithm.