answersLogoWhite

0

📱

Computer Programming

A category for questions about computer programming and programming languages.

10,506 Questions

Why linear search is called sequential search?

A linear search is called a sequential search because a sequential search takes linear time and therefore has a worst-case time-complexity of O(n) for a data sequence of n elements. Although there are more efficient search algorithms than linear search, not all data containers are ideally suited to them. For example, although a binary search can be performed in quadratic time (O(log n)) when the data container is in sorted order, we can only achieve maximum efficiency when the data container also supports constant-time random-access. Arrays and vectors do support constant-time random-access, but if the container is not sorted then we must resort to the less-efficient linear search. Linked lists do not support constant-time random-access thus a linear search would be more efficient even if the list were in sorted order.

How do you use primitive in a sentence?

Your understanding of the English language is primitive.

The behaviour of that monkey is primitive compared to my friend Bob.
He used a primitive method to draw water from the well.
Her way of thinking is really primitive.
The ancient peoples tools were very primitive.
the shirt was very primitive.

What will happen if you will assign a value to float variable which is beyond the range of float data type?

Then data will be lost. Quite often, at least in Java, the compiler will protest at compile time, basically forcing you to rethink your strategy.

How can you create infinite instances of the same class using Python?

try using a never ending looping statement

(I know that I need a while/for loop, but I don't know how to assign variables to a randomly generated string)

Describe the analysis stage of a sdlc?

Sldc is a operation that can be operate each other

How do you display .dwg file on asp 2.0?

First of all, which do you need? An application which bases on Net FrameWork or a website which uses asp 2.0 technical?

The answer of the two questions is that both of them are achievable. To display .dwg on asp 2.0, you need: * to use: a development tool which support Net FrameWork (e.x. Visual Studio 2008) * to make sure you know: a development language (e.x. VB, C#) * to get: a .dwg viewer ActiveX control (e.x. ocx) Main idea of making a web based application - Add COM components in your project.

Main idea of making a website page - Add referecne in your website.

How do you write a program in lisp to find if a number is prime or not?

(defun prime (num)

(if (< 2 num)

(do ((dividend 2 (1 + dividend))

(chk-to (sqrt num)))

((equal (rem num dividend) 0))

(when (<= chk-to dividend)

(return t)))

t))

How do you find the orthocenter of a triangle?

The orthocenter is the point of concurrency of the altitudes in a triangle. A point of concurrency is the intersection of 3 or more lines, rays, segments or planes. The orthocenter is just one point of concurrency in a triangle. The others are the incenter, the circumcenter and the centroid.


My daughter's math teacher recommended the following site, which was enormously helpful for her. Here's a link to the 'orthocenter' topic, and you can find a bunch of other math topic videos there. It is all free. Hope it will help.

http://www.brightstorm.com/d/math/s/geometry/u/constructions/t/constructing-the-orthocenter

What is meant by ones-compliment of a decimal number?

One-complement applies to binary values, not decimal values. Therefore when we say the ones-complement of a decimal value we mean convert the value to binary, invert all the bits (the ones-complement), then convert the result back to decimal.

For example, the decimal value 42 has the following representation in 8-bit binary:

00101010

If we invert all the bits we get 11010101 which is 213 decimal. Thus 213 is the ones-complement of 42, and vice versa.

However, it's not quite as straightforward as that because some (older) systems use ones-complement notation to represent signed values, such that 11010101 represents the decimal value -42. The problem with this notation is that the ones-complement of 00000000 is 11111111 which means the decimal value 0 has two representations, +0 and -0 respectively. In the real-world, zero is neither positive nor negative.

To resolve this problem, modern systems use twos-complement to represent signed values. The twos-complement of any value is simply the ones-complement plus one. Thus the ones-complement of 42 becomes -43, therefore the twos-complement of 42 is -43+1 which is -42. Thus -42 is represented by the binary value 11010110 in twos-complement notation.

With twos-complement, there is only one representation for the value 0. This is because the ones-complement of 00000000 is 11111111 and if we add 00000001 we get 00000000. Note that we don't get 100000000 because the result cannot have any more bits than were in the original value. When an "overflow" occurs, we cycle back to zero. As a result, incrementing and decrementing signed values has exactly the same logic as incrementing or decrementing unsigned values and flipping the sign of any value is only slightly more complicated by the extra addition operation. However, flipping the sign of a value is a much rarer operation than counting so the cost is trivial compared to the cost of counting operations using ones-complement (because there are two values for zero).

Note that ones-complement notation allows an 8-bit value to store signed values in the range -127 to +127, whereas twos-complement allows a range of -128 to +127 (through the elimination of the extra zero). But in unsigned notation, both allow the same range: 0 to 255.

Although we rarely encounter ones-complement notation, it is important to keep in mind that not all systems use twos-complement notation, particularly when working with low-level but portable programming languages. This is the reason why both the C and the C++ standards state that the range of an 8-bit signed value is only guaranteed to store values in the range -127 to +127.

Convert 1234 bits to kilobits?

1234 is SI(kilobit) ~1.205kb or IEC(kilobit) 1.234kb. As defined by SI standards for binary data, a kilo-unit is 1024 base units, while the IEC defines kilo-units as 1000 base units.

Hardware manufacturers and Apple programmers usually refer to IEC units, while Linux, Microsoft programmers, and low-level programmers generally refer to SI binary units.

What do you mean by applet?

An applet is a piece of code that can be used for graphical user interaction. An applet generally uses java api's for applets. It could be a window/ a dialog box and some such gui.

Visit www.sun.com for examples on applets

What Cel Animation mean?

I am somewhat new to cel animation, but I know it has something to do with cartoon rendering. daz studio is free and has a good cartoon renderer.

What is close system in System analysis?

close system are the type of system that do not interact with the environment