Frame sorting technique used in buffers?
Basically the frame are sent from the sender side by assigning a frame id,which could be a number.During the transmission of frames across the link the frames can be transmitted out of order w.r.t the frame id assigned to each of the frame.
The frames need to be in order to maintain integrity.
Even though the frames are sent in order,during the transmission the frames may experience delay or routing or any other event which can shuffle the order.
Thus frame sorting is done at the receiver side at the buffer at the DATA Link layer
before sending it to the higher layers.
The sorting can be done in many sorting techniques like bubble sort,merge sort etc.
What are the advantages and disadvantages of data encryption algorithms?
Advantages of DES over other algorithms:
Disadvantages of DES:
What is the most easiest way to write a GUI programs?
Typically, language is not the determining factor in developing or programming a GUI. More importantly is the application that determines the development platform you are using. At that point, language is not so much of a factor. Depending on the application and development platform, certain languages are better suited though, so once you choose your application, then you pick from the languages that are available. Still though, ease should not be a factor, but servicibility and reliability are way more important than ease of programming. If you can eliminate all other factors, than you can pick the simplest platform available, usually the highest level programming language that has everything you need is a good choice.
That said, some programmers will just go for the simplest platforms every time and try to shoehorn it into the problem they are trying to solve. Java's as popular choice for some apps, WinForms on .NET are also really simple for Windows apps, you can use various languages for that though, C# is pretty easy if you have the tools. Really depends on what you want to do for your GUI though, so there's not really one answer. You have to answer questions like, Is it a Web app, Phone app, Windows app, Apple App, or what? That really determines your programming language.
How can you determine the address of a two dimensional array element in c?
If the array is a local fixed-length array, use the address-of operator (&).
Example:
int x[3][4]; // local fixed-length array
int* p = &x[2][1]; // obtain the address of element x[2][1]
//...
For variable-length arrays we need to use a pointer and separate variables to keep track of the dimensions. C uses row-major semantics so the first dimension specifies the number of rows. However, the type of element in each row is not int, it is int[4], as per the second dimension. In other words, it is one-dimensional array of 3 one-dimensional arrays each of length 4. However, we cannot have a pointer of type int[4] because int[4] also decays to a pointer. We could use a pointer to pointer to int (int**), however in order to allocate the array contiguously without having to maintain a separate array of pointers into the second dimension, it is simpler to treat the array as if it were one-dimensional using a pointer to int (int*). After all, the actual elements we wish to access are integers, so that's what we should really be referring to, rather than to rows of arrays of integers which adds an unnecessary level of indirection. This then means we must use pointer-arithmetic to determine the address of each element. The following demonstrates how to use pointer arithmetic to access each element of a two-dimensional array through a pointer given only the row and column of the element we wish to access:
const size_t rows = 3;
const size_t cols = 4;
int* array2d = malloc (rows * columns * sizeof (int)); // allocate memory to the array
for (int row=0; row<rows; ++row) {
for (int col=0; col<cols; ++col) {
int* p = array2d + (row * cols) + col;
// ...
}
}
free (array2d); // release allocated memory
Here, row * cols determines the offset address of the start of the given row. array2d refers to the start address, so adding array2d gives us the actual address of the row. Adding col then gives us the address of the element within the given row. Note that array2d, &array2d and &array2d[0] are equivalent; they all refer to the start address of the array.
The same technique can also be used when passing a two-dimensional array to a function:
void f (int* array2d, const size_t rows, const size_t cols) {
for (size_t row=0; row<rows; ++row) {
for (size_t col=0; col<cols; ++col) {
int* p = array2d + (row * cols) + col;
// ...
}
}
}
What is difference in operating threads or process threads?
A process is an instance of a computer program. Each process has its own address space and executes concurrently with other processes. If the system has multiple CPU cores, two or more processes may execute simultaneously.
Every process has at least one thread of execution, the main thread. Any thread within a process can instantiate a new thread of execution within that same process. Every thread shares the same address space as the process itself, however each thread has its own local stack. This makes it possible for two threads to call the same function concurrently. If the system has multiple CPU cores, two or more threads within the same processes may execute simultaneously.
Programmers use multiple thread to divide complex tasks into simpler tasks that can be executed concurrently. As a simple example, suppose we must search an unsorted array of 1 million elements. We could use a single thread and search the entire array from beginning to end but there's a 50/50 chance the element we are looking for resides in the second half of the array which means that we'd need to search through 500,000 elements on average. By dividing the array between two worker threads we should get a result twice as quickly because each thread now only searches an average of 250,000 elements. It therefore follows that the more threads we utilise, the quicker we should get a result, but that's only true up to a point because the number of threads we can physically execute simultaneously depends on the number of CPU cores available. If all threads execute upon the same core then there is no point in multi-threading this particular task. Nevertheless, the task is likely to take some time to complete so it would still be beneficial to delegate the task to at least one worker thread.
For example, if the main thread manages a message queue, the worker thread can post messages to the queue to keep the main thread abreast of its progress. Meanwhile, the user can continue to interact with the process, posting messages to the queue to perhaps initiate another search (in another thread). In this way the main thread's task is reduced to nothing more than processing messages and delegating tasks to worker threads. This is clearly an over-simplification, however it's this type of multi-threading that makes it possible for a graphical user interface to remain responsive to user interactions while time-consuming tasks are being carried out in the background by worker threads.
What is a compiler and an interpreter?
a compiler translates an entire program and then executes it while an interpreter translates and executes one line of a program at time
What are the Advantages of binary search on linear search in c?
(i) Binary search can interact poorly with the
memory hierarchy (i.e. caching), because of its
random-access nature. For in-memory
searching, if the interval to be searching is
small, a linear search may have superior
performance simply because it exhibits better
locality of reference.
(ii) Binary search algorithm employs recursive
approach and this approach requires more stack
space.
(iii) Programming binary search algorithm is
very difficult and error prone (Kruse, 1999).
What is object oriented programming and visual basic.net?
Yes, Visual basic uses Objects. I.E. buttons, options buttons, forms, text boxes, these are all objects in VB. VB also allows the creation and use of COM classes.
Visual basic is partially OOP as it does not support implementation inheritance, which is usually a feature of an object-oriented language.
What is the first in first out data structure?
In computer programming, first-in first-out (short FIFO) describes a data structure which implements a chronological order, such that when multiple elements are added to the data structure, the normal retrieval method returns the elements in the order in which they were added.
FIFO structures are often used to implement queues and buffers. The alternative commonly used chronological sorting container is LIFO, short for last-in first-out.
How do you compute the nth Fibonacci number using VBScript?
<html>
<body>
<script type="text/vbscript">
Dim a, b, c, n, nth
a = 0
b = 1
n = Cint(InputBox("Enter the value of ""n"""))
For nth = 1 to n Step 1
Document.Write(b&"<br/>")
c = a + b
a = b
b = c
Next
</script>
</body>
</html>
How do you draw a flowchart using case statement?
double discount; // Usually code would be read in char code = 'B' ; switch ( code ) { case 'A': discount = 0.0; break; case 'B': discount = 0.1; break; case 'C': discount = 0.2; break; default: discount = 0.3; } System.out.println ( "discount is: " + discount );
What programming language does YouTube use?
If your are thinking of youtube it uses a variety of languages. It defiantly uses flash and JavaScript for its front end and some sort of SQL for its data base. It uses several other languages too but those listed above are the only ones I am sure of.
Write an algorithm for quick sort?
#include <stdio.h>
#include <stdlib.h>
#define size 50
void swap(int *x,int *y)
{
int temp;
temp = *x;
*x = *y;
*y = temp;
}
int partition(int i,int j )
{
return((i+j) /2);
}
void quicksort(int list[],int m,int n)
{
int key,i,j,k;
if( m < n)
{
k = partition(m,n);
swap(&list[m],&list[k]);
key = list[m];
i = m+1;
j = n;
while(i <= j)
{
while((i <= n) && (list[i] <= key))
i++;
while((j >= m) && (list[j] > key))
j--;
if( i < j)
swap(&list[i],&list[j]);
}
// swap two elements
swap(&list[m],&list[j]);
// recursively sort the lesser list
quicksort(list,m,j-1);
quicksort(list,j+1,n);
}
}
void printlist(int list[],int n)
{
int i;
for(i=0;i<n;i++)
printf("%d\t",list[i]);
}
void main()
{
int n,i;
int list[size];
printf("How many numbers do you want to enter");
scanf("%d",&n);
printf("Enter the numbers you want to sort");
for(i=0;i<n;i++)
{
scanf("%d",&list[i]);
}
printf("The list before sorting is:\n");
printlist(list,n);
// sort the list using quicksort
quicksort(list,0,n-1);
// print the result
printf("The list after sorting using quicksort algorithm:\n");
printlist(list,n);
}
What causes internal fragmentation?
External fragmentation is the phenomenon in which free storage becomes divided into many small pieces over time.[1] It is a weakness of certain storage allocation algorithms, occurring when an application allocates and deallocates ("frees") regions of storage of varying sizes, and the allocation algorithm responds by leaving the allocated and deallocated regions interspersed.
How do you convert integer to float?
Sure especially in programming. Generally an int can be passed directly into a float.
Examples:
9 is an integer
9.00 is a float
in programming
int A = 9;
Float B = A;
What is difference between macro processor and macro assembler?
A macro processor processes macros. So what do you think a macro call does, play the flute. The answer is in the question and that begs the question of are you suited to computer programming specifically and an education in general. You are showing a marked reluctance to thinking.
In computer science, const-correctness is the form of program correctness that deals with the proper declaration of objects as mutable or immutable. The term is mostly used in a C or C++ context, and takes its name from the const keyword in those languages. The idea of const-ness does not imply that the variable as it is stored in the computer's memory is unwriteable. Rather, const-ness is a compile-time construct that indicates what a programmer may do, not necessarily what he or she can do. In addition, a class method can be declared as const, indicating that calling that method does not change the object. Such const methods can only call other const methods but cannot assign member variables. (In C++, a member variable can be declared as mutable, indicating that a const method can change its value. Mutable member variables can be used for caching and reference counting, where the logical meaning of the object is unchanged, but the object is not physically constant since its bitwise representation may change.) In C++, all data types, including those defined by the user, can be declared const, and all objects should be unless they need to be modified. Such proactive use of const makes values "easier to understand, track, and reason about," and thus, it increases the readability and comprehensibility of code and makes working in teams and maintaining code simpler because it communicates something about a value's intended use. For simple data types, applying the const qualifier is straightforward. It can go on either side of the type for historical reasons (that is, const char foo = 'a'; is equivalent to char const foo = 'a';). On some implementations, using const on both sides of the type (for instance, const char const) generates a warning but not an error. For pointer and reference types, the syntax is slightly more subtle. A pointer object can be declared as a const pointer or a pointer to a const object (or both). A const pointer cannot be reassigned to point to a different object from the one it is initially assigned, but it can be used to modify the object that it points to (called the "pointee"). (Reference variables are thus an alternate syntax for const pointers.) A pointer to a const object, on the other hand, can be reassigned to point to another object of the same type or of a convertible type, but it cannot be used to modify any object. A const pointer to a const object can also be declared and can neither be used to modify the pointee nor be reassigned to point to another object. The following code illustrates these subtleties: void Foo( int * ptr, int const * ptrToConst, int * const constPtr, int const * const constPtrToConst ) { *ptr = 0; // OK: modifies the pointee ptr = 0; // OK: modifies the pointer *ptrToConst = 0; // Error! Cannot modify the pointee ptrToConst = 0; // OK: modifies the pointer *constPtr = 0; // OK: modifies the pointee constPtr = 0; // Error! Cannot modify the pointer *constPtrToConst = 0; // Error! Cannot modify the pointee constPtrToConst = 0; // Error! Cannot modify the pointer To render the syntax for pointers more comprehensible, a rule of thumb is to read the declaration from right to left. Thus, everything before the star can be identified as the pointee type and everything to after are the pointer properties. (For instance, in our example above, constPtrToConst can be read as a const pointer that refers to a const int.) References follow similar rules. A declaration of a const reference is redundant since references can never be made to refer to another object: int i = 42; int const & refToConst = i; // OK int & const constRef = i; // Error the "const" is redundant Even more complicated declarations can result when using multidimensional arrays and references (or pointers) to pointers. Generally speaking, these should be avoided or replaced with higher level structures because they are confusing and prone to error.
On the computer system what is the difference of binary and decimal?
There is no difference. Decimal notation is merely a human convenience. The same rules that apply to decimal also apply to binary, the only difference being that decimal has 10 digits and deals with powers of 10, while binary uses 2 digits and deals with powers of 2. Binary (base-2) is the most primitive form of numeric notation and by far the simplest to implement at the machine level.
What are some of the new roles information system are playing in organization?
A management information system is a system that has important tools to supports, analyse, delivery and adding reliability to any organisation. Also this helps to solve businesses problems. The term MIS is often used to submit to a group of information management methods tied to the support of human decision making, e.g. Decision Support Systems, Expert systems, and Executive information systems.
The RAM is like a dish holder. When required the disk is used and when the process is complete we keep the dishes back in its place again. Imagine the dishes to be empty spaces in the RAM. When a software or a program wants to run then a dish is utilised in the process and when the program is terminated the dish is again placed back in its place so that other programs can utilise the free space.
What are the different types of microcomputers?
) Desktop Personal Computer II) Laptop Personal Computer
III) Palmtop Computer / Personal Digital Assistant ( PDA)
IV) Workstation / Server
What are the function of flowcharts?
Figure 7: Flowchart of the MATLAB function simulate.m.
The flow of each of the blocks is then repeated starting at Numerical Integration for Calculating with . In order to execute the blocks in the flowchart, simulate.m calls upon many MATLAB and C functions, each of which are briefly described below.
The function simulate.m is called by a wrapper function rcvsim.m for execution at the Linux prompt. This wrapper function takes two command line arguments: 1) the name of a file containing the desired parameter values and 2) the prefix name of the output files to be generated in MIT format. The function rcvsim.m, which also includes a help option, reads in the parameter file with read_param.m (see above), creates a header file in MIT format, executes simulate.m, writes the simulated data to MIT format files if the on-line viewing option is not chosen, and displays cardiac function and venous return curves, if desired, with the function plot_cfvr.c (which employs Gnuplot). In order to execute rcvsim.m, the function must be compiled with the filemake.m which creates the binary file rcvsim. The function simulate.m may also be compiled independently of rcvsim.m with the file makem.m which creates the binary file simulate.mexlx (in the Linux environment). Each of these make files greatly improve execution speed specifically through mcc (MATLAB compiler) optimization arguments r (real numbers only) and i(no dynamic memory allocation). Note that simulate.m may only be executed in the MATLAB environment without on-line viewing and parameter updating capabilities.
If circle diameter is 12 what is circumference?
A 12-inch diameter circle has a circumference of: 37.7