How sparse matrix can be stored using array?
#include<stdio.h>
int main()
{
int a[20],min,max;
int n;
printf("\nEnter the num of elements: ");
scanf("%d",&n);
printf("Enter the elements\n");
for(int i=0;i<n;i++)
{
scanf("%d",&a[i]);
if(i==0)
{
min=max=a[i];
}
if(a[i]<min)
min=a[i];
else if(a[i]>max)
max=a[i];
}
printf("The largest element is %d. The smallest element is %d.", max, min);
}
Write a C program using dynamic memory allocation to subtract two matrices?
The easiest way would be to write a function that accepts two arrays and returns one.
Lets say you are working with two 2-dimensional arrays.
array<int,2>^ SubtractMatrices(int arr1[][2], int arr2[][2]);
void main()
{
int arr1[2][2] = {0,1,2,3};
int arr2[2][2] = {0,1,2,4};
array<int,2>^ newarr;
// array<int^,2>^ newarr[2][2] = SubtractMatrices(arr1, arr2);
}
array<int,2>^ SubtractMatrices(int arr1[][2], int arr2[][2])
{
array<int,2>^ newarr;
//Insert subtraction algorithm here
return newarr;
}
In this scenario you must pass the function 2 matrices, and then return a pointer to a new matrix.
Hmm, still seems to be an error in there with the return type. I'm not sure if that's the correct way to do it, I did this in Visual Studio's managed C++. .
Why does graphical user interface programming often use event driven programming paradigm?
It's not a case of often, but always. Whenever your application is idle the application's idle loop is executed. By default, the idle loop simply processes system messages which may result in your application becoming active. For instance, as you pass the mouse over your application window, the operating system generates and posts hundreds of mouse movement messages which are passed to the message queue. The application's idle loop will process these messages and call the appropriate event handlers. Mouse movements may not be relevant to your application but they must be processed nonetheless. When the message queue is empty, the idle loop begins background processing. By default this does nothing except peak at the message queue looking for new messages for your application, but it can be overridden to perform any tasks that take your fancy (such as housekeeping tasks).
However, when the user clicks an object in your window (such as a command button), you would rightly expect your application to respond to that particular event. Thus the appropriate event handler is executed and control eventually returns to the idle loop again.
Problems occur when the event handler executes a highly-intensive task and therefore cannot yield control to the idle loop. This isn't a major problem if the task would only take a few seconds at most to complete, but if it takes any appreciable time this presents a serious problem. If your application does not process messages that are intended for it, then those messages will prevent other programs from gaining access to their messages. And as the message queue fills up, the system, grinds to a halt. Higher priority messages will still get through but the system will quickly become unresponsive.
To address this problem, your application must provide a user-defined message handler that can be periodically called by your intensive tasks, preferably two or more times every second to keep the system as responsive as possible. This message handler needn't be complex, but it must return a value to the caller to signal if the caller should abort or continue processing. For instance, if the user chooses to shut down the system mid-process, your intensive task must be able abort gracefully before the application itself can exit gracefully. This means your message handler must save and remove the message from the queue and signal the process to abort. The message handler may be called several times before the process finally aborts, but when it does control can pass to the idle loop which will finally deal with the message that caused the abort, thus permitting a graceful exit.
What is the difference between object oriented approach and procedure oriented approach?
Object oriented focuses on treating variables as objects that have the ability to perform certain tasks. Procedure oriented uses procedures (functions) to perform tasks on variables. For example, if you were writing a program for a DVD rental store:
Object Oriented:
thisdvd.assignTitle("Lethal Weapon");
thisdvd.rentTo("John Smith");
Procedure Oriented:
String thisdvdnumber = 123;
rentDvd(thisdvdnumber, "John Smith");
In the first case, you call functions that belong to object "thisdvd", like assignTitle(), rentTo(), etc. In the second case, you create a variable "thisdvdnumber", then call function "rentDvd()" and tell it which DVD to rent and to whom by passing those variables to it.
Disadvantages of the system development life cycle?
from http://www.phonemania.com.pk/
Unix command to count how many users have logged on to the unix system?
The 'uptime' command will tell you exactly how many users are on the system. There are other variations of this, including counting the number of words from the 'users' command, etc., but this is the easiest.
What do you mean when you say Embed Video?
Embed video means to embed, or place, a video within the HTML code of the page you are posting on.
You can add video using HTML code - you will need more then basic HTML knowledge.
Embedding a video player plugin is much easier. You just need to embed simple code provided by plugin creator.
How do you implement a stack using two queues?
implementing stack using two queues
initially q1 is full and q2 empty
1] transfer elements from q1 to q2 till last element left in q1
2] loop till q2 is not empty
deque element from q2 and again push in q2 till last element is left in q2
transfer this last element in q1
reduce size of q2 by 1
3]finally q1 contains all elements in reverse order as in stack
eg
1]
q1 = 1 2 3 4
q2 =
2]
3 deques till last element left in q1
q1 = 4
q2 = 1 2 3
3]
deque and again queue q2 till last element left
q1 = 4
q2 = 3 1 2
4] deque q2 and queue q1
q1 = 4 3
q2 = 1 2
5] again
deque and queue q2 till last element left
q1= 4 3
q2= 2 1
6] queue q1
q1= 4 3 2
7] queue last element of q2 to q1
q1= 4 3 2 1
A credential program is a structured educational course designed to provide individuals with the specific skills and qualifications needed to obtain a professional credential or license in a particular field. These programs often focus on practical training and may include coursework, assessments, and field experiences. They are commonly found in areas such as education, healthcare, and technical trades, helping participants enhance their employability and expertise. Credential programs can vary in duration and may lead to certification or licensure upon completion.
Any five uses of computer in Scientific Research?
It is used for
1.to do complex computations
2. for data analysis
3. modelling
4.Calculations
5.Storage and Data Transfer
6.Mapping
-SubhaGolu
Write a program in c to find the area of rectangle using array?
#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float len,bre,area;
clrscr();
printf("\n\n\t\tEnter the length of the rectangle=\t");
scanf("%d",&len);
printf("\n\n\t\tEnter the breadth of the rectangle=\t");
scanf("%d",&bre);
printf("\n\n\t\tArea of the rectangle=\t%3f",area=l*b);
getch();
}
Give you the fullform of TCS which is software company?
Tata Consultancy Services, with is a division of Tata, one of the largest companies in India
Which number comes next in this series 11-13-17-25-32-37-47-58?
71
79
95
109
The series:
Sn+1 = Sn + Sum of the digits of Sn with S0 = 11
What is the process of binary search?
1. //ALGORITHM:Bin search(a,i,l,x).
2. //given an array a(i,l) of elements in non-decreasing.
3.// order,1<=i<=l,determine wether x is present and
4. //if so,return j such that x=a[j],else return 0.
5. {
6. if(l=i) then
{
if(x=a[i] then return i;
else return 0;
}
else
{
mid=[(i+l)/2]
if(x-a[mid] then return mid
else if(x<a[mid]) then
return Bin search(a,i,mid-1,x)
else return Bin search(a.mid+1,l,x)
}
}
What is a frequency count in data structure?
In this Method number of operations are counted. The actual time is proportional to this count.
The highest order of the frequency count variable in the total time expression is known as Order of the complexity denoted by Big Oh notation i.e O().
Less the order of complexity , more efficient is the algorithm.
Vinay kr. sharma
(Mtech)
(Sr. Faculty in Uptron Acl- South x-I)
What are the example of web - based application?
As an example, suppose a travel agent wanted customers to be able to identify desired destinations and dates of travel, at which time the agent would present the customer with a customized Web page containing only the information pertinent to that customer's needs. In this case the travel agent's website would first provide a Web page that presented a customer with the available destinations. On the basis of this information, the customer would specify the destinations of interest and desired dates of travel (a client-side activity).
Another example occurs when using the services of a search engine. In this case a user at the client specifies a topic of interest (a client-side activity) which is then transferred to the search engine where a customized Web page identifying documents of possible interest is constructed (a server-side activity) and sent back to the client.
Induction:
1. A tree of one node has two NULL-pointers.
2. Whenever you add a node to a tree, you remove one NULL-pointer (from the parent of the new node), and add two (the child's of the new node) in the same time.
A zero based integer is a number that is either zero or a whole number. Zero based integers are usually used in programming computers with a binary code.
What are the advantages of file organisation?
Disadvantages of File Processing Systems include:
1. Program-Data Dependence. File descriptions are stored within each application program that accesses a given file.
2. Duplication of Data. Applications are developed independently in file processing systems leading to unplanned duplicate files. Duplication is wasteful as it requires additional storage space and changes in one file must be made manually in all files. This also results in loss of data integrity. It is also possible that the same data item may have different names in different files, or the same name may be used for different data items in different files.
3. Limited data sharing. Each application has its own private files with little opportunity to share data outside their own applications. A requested report may require data from several incompatible files in separate systems.
4. Lengthy Development Times. There is little opportunity to leverage previous development efforts. Each new application requires the developer to start from scratch by designing new file formats and descriptions
5. Excessive Program Maintenance. The preceding factors create a heavy program maintenance load. 6. Integrity Problem. The problem of integrity is the problem of ensuring that the data in the database is accentuate. 7. Inconsistance data 8. Security ---- . The Problem of security in file processing is Non Programmer can retrieve modify, delete and insert the data in data base. But this is not possible in DBMS
Is pascal high level language?
The original Pascal programming language was designed by Niklaus Wirth between 1968 and 1969, published in 1970. Object Pascal was developed in 1985 by Larry Tessler, in consultation with Wirth.
How do you get your computer to run faster?
Multiple ways, try to de-fragment it, or the biggest help switch to a linux operating system.
Why is assembly language efficient?
Assembly uses commands you can begin to understand, like JSR (Jump to subroutine which changes points in a code) machine code on the other hand is the code that the machine reads. This would only look like numbers to you, probably in hex code. Basically the higher level a language is the easier to understand because of the level of abstraction. It goes, machine code, assembly language, then things like C then java or visual basic. In VB you can write commands almost the same as you would construct an English sentence, the compiler then converts this down to machine code which the processor can understand and execute.
Got it?
The Multimedia PC, or MPC, was a recommended configuration for a PC with a http://www.answers.com/topic/cd-rom drive. The standard was set and named by the "Multimedia PC Marketing Council", which was a working group of the http://www.answers.com/topic/software-and-information-industry-association (now the Software and Information Industry Association). The MPMC comprised companies including http://www.answers.com/topic/microsoft, http://www.answers.com/topic/creative-technology, http://www.answers.com/topic/dell-technology, http://www.answers.com/topic/gateway-computers-1, and http://www.answers.com/topic/fujitsu. Any PC with the required standards could be called an "MPC" by licensing the use of the logo from the SPA. CD-ROM drives were just coming to market in http://www.answers.com/topic/1990, and it was difficult to concisely communicate to a consumer all the hardware requirements for using "multimedia software", which mostly meant "displaying video on a PC via a CD-ROM drive". The MPC standard was supposed to communicate this concisely, so a consumer buying hardware or software could simply look for the MPC logo and be assured of compatibility. The MPC program was never a success and it is rare today to see software or hardware labeled with the term "MPC". As the standardized term failed to catch on, and as the Software Publishers Association turned away from consumer software in the late http://www.answers.com/topic/ninety, interest in the MPC standard vanished. The problem of software labeling continues, especially in the field of http://www.answers.com/topic/personal-computer-game, where a plethora of 3D video cards has been manufactured with an extremely wide range of display capabilities, and no common industry labeling standard to let consumers know whether their card is powerful enough to let them play a particular game. The first MPC minimum standard, set in 1990, was: * 16 http://www.answers.com/topic/hertz http://www.answers.com/topic/386sx CPU * 2 http://www.answers.com/topic/megabyte http://www.answers.com/topic/ram-memory-device * 30 MB http://www.answers.com/topic/hard-disk-drive-1 * http://www.answers.com/topic/8-bit-color, 640×480 http://www.answers.com/topic/video-graphics-array video card * 1x (single speed) http://www.answers.com/topic/cd-rom drive using no more than 40% of CPU to read, with < 1 second http://www.answers.com/topic/seek-time * http://www.answers.com/topic/sound-card outputting 22 kHz, http://www.answers.com/topic/quantization-sound-processing; and inputting 11 kHz, 8-bit sound * http://www.answers.com/topic/windows-3-0 with Multimedia Extensions. In 1993, an MPC Level 2 minimum standard was announced: * 25 MHz http://www.answers.com/topic/intel-80486sx CPU * 4 MB RAM * 160 MB hard disk * http://www.answers.com/topic/16-bit-color, 640×480 VGA video card * 2x (double speed) CD-ROM drive using no more than 40% of CPU to read at 1x, with < 400 http://www.answers.com/topic/1-e-3-s seek time * Sound card outputting 44 kHz, 16-bit "http://www.answers.com/topic/compact-disc" sound. * Windows 3.0 with Multimedia Extensions, or http://www.answers.com/topic/windows-3-1x In 1996, MPC Level 3 was announced: * 75 MHz http://www.answers.com/topic/pentium CPU * 8 MB RAM * 540 MB hard disk * Video system that can show 352×240 at 30 http://www.answers.com/topic/frame-rate, 16-bit color * http://www.answers.com/topic/mpeg-1 hardware or software video playback * 4x CD-ROM drive using no more than 40% of CPU to read, with < 250 ms http://www.answers.com/topic/seek-time * Sound card outputting 44 kHz, 16-bit "CD quality" sound. * http://www.answers.com/topic/windows-3-1x