Skip to main content

Complexity of an algorithm

Introduction
An algorithm is a mathematical method for calculating or computation (The computation of a function), and which can be carried out mechanically, without thinking. Algorithm complexity is concerned about how fast or slow performing specific algorithm. We define complexity as a numerical function T (n) - time in relation to the input size n. We want to specify a time in which there is no algorithm depends on implementation details. But you agree that T (n) is dependent on the performance! A specific algorithm is different amount of time to both inputs depending on factors such as processor speed; instruction set, disk speed, brand and compilers etc. The way around is to estimate the efficiency of each algorithm asymptotically. We will take time to measure T (n) the number of elementary "steps" (defined in any way), provided that each such step lasts for a constant time.

Let us consider two classic examples: adding two numbers. We will add two integers digit by digit, and it will define a "step" in our computational model. That is why we say that the addition of two n-bit integers taking steps n. Accordingly, the total computation time is T (n) = n * c, where c is the time that the addition of two bits. In different computers can addition of two pieces different time seizures, C1 and C2 say, making the addition of two n-bit integers takes T (n) = c1 * n and T (n) = C2 * n, respectively. It shows that various machines of different slopes, but the time T (n) grows linearly increases as input magnitude.

Comments

Popular posts from this blog

How to set up a passkey for your Apple account

  Passkeys are a new and more secure way to sign in to your Apple account. They are similar to passwords, but they are stored on your device and are not shared with Apple. This makes them more resistant to phishing attacks and other security threats. Passkeys are currently not available for Apple accounts. However, they are expected to be available in a future software update. Set up a passkey for Apple account When passkeys are available, you will be able to set up a passkey for your Apple account by following these steps: 1.     Go to the Settings app on your Apple device. 2.     Tap on your name at the top of the screen. 3.     Tap on "Password & Security." 4.     Tap on "Passkeys." 5.     Tap on "Set Up Passkey." 6.     Follow the on-screen instructions to create a passkey. Once you have created a passkey, you will be able to use it to sign in to your Apple account on...

Requirement for connecting to the Internet

The basic requirements for connecting to the Internet are a computer device. In addition,   you need the following things, to connect to the Internet: (i)           Modem (ii)          Telephone wire (iii)         Internet Service Provider (ISP) (iv)        Internet connection (v)         Web-browsing software Modem (modulator-demodulator) A modem is a device that enables a computer to transmit data over telephone or cable lines. Computer stored information digitally; information transmitted over telephone lines in the form of analog waves. A modem converts between these two forms. A modem can be either internal or external. The internal modem is attached to a slot on the motherboard. The external modem can be placed anywhere outside the system unit and connected to the ...

Approaches of comparative education

  Apollo (1986) identified eight approaches to the study of Comparative Education. They are: 1. Problem Approach or Thematic approach 2. Case study approach 3. Area study approach 4. Historical approach 5. Descriptive approach  6. Philosophical approach  7. International approach and 8.  Gastronomic approach 1. Problem approach or thematic approach —   In this approach the investigator will first of all identify a particular educational problem in his own country. Then, he will begin to look for another country that has the same problem . —   The researcher will also study the education problem of another country in relation to their culture. The researcher will not only study the educational problem of another country but he will also examine the solution applied to such problem by the affected country . 2. Case study approach   —   In this approach, an education comparativist from Nigeria can go to Iraq to study the...