answersLogoWhite

0

📱

Computer Science

Computer Science is the systematic study of algorithmic processes that describe and transform information. It includes the theoretical foundations of information and computation and the practical techniques of applying those foundations to computer systems. Among the many subfields of Computer Science are computer graphics, computer programming, computational complexity theory, and human-computer interaction. Questions about Computer Science, terms such as algorithms and proofs, and methodologies are encouraged in this category.

1,839 Questions

What are the uses of macros?

With macros, you can perform long or boring tasks just by a single click or keystroke combination. Also, you would not need to repeat the same action over and over again.

Can borland compiler perform the graphics in c?

No. But programs compiled with Borland compilers might be able, platform-dependent.

How function can be nested in c?

A function can call other functions (or itself), but a function-definition cannot be nested in another function-definition:

int main (void)

{

void wont_compile (void) { puts ("Won't compile"); }

wont_compile ();

return 0;

}

Which header file is used to develop a function that can accept variable number of arguments?

.If you want to accept variable no of arguments then you have to include which of the following header files

a) Vararg.h b) stdarg.h c) stdlib.h d) stdioh

What is the difference between gets and puts?

Direction:

gets: from standard input to memory

puts: from memory to standard input

note: 'gets' is unsafe, use 'fgets' instead

What happens when a program is compiled?

when you compile your program , it is sequentially checking your coding and check whether there is an error. thats the simple thing happening. if there is no error, then it will create an executable file for your coding which is run when you ask to run the program after compiling. if your coding have an error, then you have to correct those errors. REMEMBER that it is compulsory to compile the program after you correct the errors. otherwise, it will not make an executable file with your corrections.

What language does the computer use and understand?

Dual system 1 and 0

It can also depend what you mean by computer, and how deep you want to go. You can make a "Computer" with wood and strings, as proven by the Jaquard Loom. Hardware is key, no matter how basic. So, in theory (i guess) the Basic Language would be how the computer...works! If you want to go to the very basics.

What is worst case complexity of quick sort?

Selection sort has no end conditions built in, so it will always compare every element with every other element.

This gives it a best-, worst-, and average-case complexity of O(n2).

How can insert a data into file in c?

You insert data into a file by copying the file to a temporary file up to the point of insertion, then copying the data to be inserted, then copying the balance of the original file. After closing the temporary file you delete the original file and rename the temporary file back to the original file's name.

1 What are the three basic functional blocks of a computer?

Binary bits. This is 0s and 1s. Everything else is built up from these 0s and 1s to make more human-understandable language.

0s and 1s are used because it is very easy to make clear, definable electrical signals for 0 and 1. It is simply "on" and "off".

What is the worst case and best case of bubble sort?

There is no worst case for merge sort. Each sort takes the same amount of steps, so the worst case is equal to the average case and best case. In each case it has a complexity of O( N * log(N) ).

What is recursive algorithm?

Algorithm can be defined as an interpretable, finite set of instructions for dealing with contigencies and accompanying task that has recognizable end-points for given inputs. It is a tool for solving a well computational problem. A recursive algorithm is one which calls itself.

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.

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.

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 Scope and limitation of the enrollment system?

Enrollment systems tend to be too complex. When students try to use them they may not complete the process because they don't understand what they are doing.

What is a linear queue?

A linear queue models the FIFO(first in first out) data structure, much like a line in real life. The first person in line will be the first person served, in queues the first element to be added is the first that can be removed. The only adding point is to the end of the list and the only removal point is the beginning of the list.

Queue<String> q = new LinkedList<String>(); // The LinkedList class implements Queue

q.add("Bob"); // Now Bob is at the front of the queue

q.add("Stacy"); // Stacy after Bob

q.add("Will"); // and Will after her

String removed = q.remove(); // Bob is removed

q.add("Michael"); Michael is added after Will

System.out.println(q); // Prints ["Stacy", "Will", "Michael"]

What is function of include in c language?

The #include directive is used to tell the preprocessor that the specified file's contents are to be included at the point where the directive appears, just as if you'd typed those contents in full yourself.

Include files are primarily used to organise declarations of external variables and functions, complex data types, constants and macro definitions. The code need only be declared once, and included wherever required. Think of include files as a means of providing forward declarations without having to retype those declarations in full. The definitions of those declarations needn't be contained in the included file, but they must be made available to the program, either as a linked library or as a separate source code file which includes those same declarations.

The include keyword is used in C to tell the linker what libraries your code is going to be using.

How do you add an H2 heading?

Use the <h1> tag. E.G. <h1>This is in a big heading</h1>

What is low level language?

Computer programming languages are divided into 2 types: low level languages and high level languages. There are 2 low level languages machine language and assembly language.

Machine language consists of two digits 0 and 1. 0 represents off and 1 represents on. These are called binary digits. 8 bits form 1 byte. Each byte represents a letter. For example A is represented by 01000001.

assembly language is easier than machine language. It has short words or abbreviations like ORG, MOVLW, GOTO.

Why is the JVM platform dependent?

That depends on how you look at it. The point of the JVM is to allow Java bytecode to be executed on any platform, regardless of what machine it was compiled on.

The actual implementation of the JVM, however, must be platform-specific.

Uses of computer in computer engineering?

Like many engineering classes require, computer engineering should be taking with prerequisites of electrical engineering. Computers in this field are used for the curriculum. The difference between computer engineering and computer science is that computer engineering deals with the hardware of a computer, or all the things you can see when you open a computer up, like the motherboard or hardrive. comp science deals with the software such as programs like Microsoft word for example

What are the effectiveness of algorithm?

a measure of the amount of resources consumed in solving a problem of size n-time

-space

•Benchmarking: implement algorithm,

-run with some specific input and measure time taken

-better for comparing performance of processors than for comparing performance of algorithms

•Big Oh (asymptotic analysis)

-associates n, the problem size,

-with t, the processing time required to solve the problem