In computer science, a binary tree is a tree data structure in which each node has at most two children, which are referred to as the left child and the right child. A recursive definition using just set theory notions is that a binary tree is a tuple, where L and R are binary trees or the empty set and S is a singleton set; some authors allow the binary tree to be the empty set as well. From a graph theory perspective, binary trees as defined here are arborescences. A binary tree may thus be called a bifurcating arborescence—a term which appears in some old programming books, before the modern computer science terminology prevailed, it is possible to interpret a binary tree as an undirected, rather than a directed graph, in which case a binary tree is an ordered, rooted tree. Some authors use rooted binary tree instead of binary tree to emphasize the fact that the tree is rooted, but as defined above, a binary tree is always rooted. A binary tree is a special case of an ordered K-ary tree, where k is 2.
In mathematics, what is termed binary tree can vary from author to author. Some use the definition used in computer science, but others define it as every non-leaf having two children and don't order the children either. In computing, binary trees are used in two different ways: First, as a means of accessing nodes based on some value or label associated with each node. Binary trees labelled this way are used to implement binary search trees and binary heaps, are used for efficient searching and sorting; the designation of non-root nodes as left or right child when there is only one child present matters in some of these applications, in particular it is significant in binary search trees. However, the arrangement of particular nodes into the tree is not part of the conceptual information. For example, in a normal binary search tree the placement of nodes depends entirely on the order in which they were added, can be re-arranged without changing the meaning. Second, as a representation of data with a relevant bifurcating structure.
In such cases the particular arrangement of nodes under and/or to the left or right of other nodes is part of the information. Common examples occur with Huffman coding and cladograms; the everyday division of documents into chapters, paragraphs, so on is an analogous example with n-ary rather than binary trees. To define a binary tree in general, we must allow for the possibility that only one of the children may be empty. An artifact, which in some textbooks is called an extended binary tree is needed for that purpose. An extended binary tree is thus recursively defined as: the empty set is an extended binary tree if T1 and T2 are extended binary trees denote by T1 • T2 the extended binary tree obtained by adding a root r connected to the left to T1 and to the right to T2 by adding edges when these sub-trees are non-empty. Another way of imagining this construction is to consider instead of the empty set a different type of node—for instance square nodes if the regular ones are circles. A binary tree is a rooted tree, an ordered tree in which every node has at most two children.
A rooted tree imparts a notion of levels, thus for every node a notion of children may be defined as the nodes connected to it a level below. Ordering of these children makes possible to distinguish left child from right child, but this still doesn't distinguish between a node with left but not a right child from a one with right but no left child. The necessary distinction can be made by first partitioning the edges, i.e. defining the binary tree as triplet, where is a rooted tree and E1 ∩ E2 is empty, requiring that for all j ∈ every node has at most one Ej child. A more informal way of making the distinction is to say, quoting the Encyclopedia of Mathematics, that "every node has a left child, a right child, neither, or both" and to specify that these "are all different" binary trees. Tree terminology so varies in the literature. A rooted binary tree has a root node and every node has at most two children. A full binary tree is a tree in which every node has 2 children. Another way of defining a full binary tree is a recursive definition.
A full binary tree is either:A single vertex. A tree whose root note has two subtrees. In a complete binary tree every level, except the last, is filled, all nodes in the last level are as far left as possible, it can have between 2h nodes at the last level h. An alternative definition is a perfect tree; some authors use the term complete to refer instead to a perfect binary tree as defined above, in which case they call this type of tree an complete binary tree or nearly complete binary tree. A complete binary tree can be efficiently represented using an array. A perfect binary tree is a binary tree in which all interior nodes have two children and all leaves have the same depth or same level. An example of a perfect binary tree is the ancestry chart of a person to a given depth, as each person has two biological parents. In the infinite complete binary tree, every node has two children; the set of all nodes is countably infinite, but the set of all infinite paths from the root
In astronomy, a double planet is a binary system where both objects are of planetary mass. The term is not recognized by the International Astronomical Union and is therefore not an official classification. At its 2006 General Assembly, the International Astronomical Union considered a proposal that Pluto and Charon be reclassified as a double planet, but the proposal was abandoned in favor of the current definition of planet. In promotional materials advertising the SMART-1 mission and pre-dating the IAU planet definition, the European Space Agency once referred to the Earth–Moon system as a double planet; some binary asteroids with components of equal mass are sometimes informally referred to as double minor planets. These include binary asteroids 69230 Hermes and 90 Antiope and binary Kuiper belt objects 79360 Sila–Nunam and 1998 WW31. There is debate as to what criteria should be used to distinguish "double planet" from a "planet–moon system"; the following are considerations. A definition proposed in the Astronomical Journal calls for both bodies to individually satisfy an orbit-clearing criterion in order to be called a double planet.
One important consideration in defining "double planet" is the ratio of the masses of the two bodies. A mass ratio of 1 would indicate bodies of equal mass, bodies with mass ratios closer to 1 are more attractive to label as "doubles". Using this definition, the satellites of Mars, Saturn and Neptune can all be excluded; some dwarf planets, have satellites less massive than the dwarf planets themselves. The most notable exception is the Pluto–Charon system; the Charon-to-Pluto mass ratio of 0.117 is close enough to 1 that Pluto and Charon have been described by many scientists as "double dwarf planets". The International Astronomical Union calls Charon a satellite of Pluto, but has explicitly expressed a willingness to reconsider the bodies double dwarf planets at a future time; the Moon-to-Earth mass ratio of 0.01230 is notably close to 1 when compared to all other satellite-to-planet ratios. Some scientists view the Earth-Moon system as a double planet as well, though this is a minority view.
Eris's lone satellite, has a radius somewhere around 1⁄4 that of Eris. The next criteria both attempt to answer the question "How close to 1 must the mass ratio be?" The most proposed definition for a double-planet system is one in which the barycenter, around which both bodies orbit, lies outside both bodies. Under this definition and Charon are double dwarf planets, since they orbit a point outside of Pluto, as visible in animations created from images of the New Horizons space probe in June 2015. Under this definition, the Earth–Moon system is not a double planet. However, the Moon migrates outward from Earth at a rate of 3.8 cm per year. The center of mass of the Jupiter–Sun system lies outside the surface of the Sun, though arguing that Jupiter and the Sun are a double star is not analogous to arguing Pluto-Charon is a double dwarf planet; the problem is that Jupiter is not a star, or a brown dwarf, due to its low mass it is unable to achieve any form of fusion. Isaac Asimov suggested a distinction between planet–moon and double-planet structures based in part on what he called a "tug-of-war" value, which does not consider their relative sizes.
This quantity is the ratio of the force exerted on the smaller body by the larger body to the force exerted on the smaller body by the Sun. This can be shown to equal tug-of-war value = m p m s ⋅ 2 where mp is the mass of the primary, ms is the mass of the Sun, ds is the distance between the smaller body and the Sun, dp is the distance between the smaller body and the primary. Note that the tug-of-war value does not rely on the mass of the satellite; this formula reflects the relation of the gravitational effects on the smaller body from the larger body and from the Sun. The tug-of-war figure for Saturn's moon Titan is 380, which means that Saturn's hold on Titan is 380 times as strong as the Sun's hold on Titan. Titan's tug-of-war value may be compared with that of Saturn's moon Phoebe, which has a tug-of-war value of just 3.5. So Saturn's hold on Phoebe is only 3.5 times as strong as the Sun's hold on Phoebe. Asimov calculated tug-of-war values for several satellites of the planets, he showed that the largest gas giant, had only a better hold than the Sun on its outer captured satellites, some with tug-of-war values not much higher than one.
In nearly every one of Asimov's calculations the tug-of-war value was found to be greater than one, so in those cases the Sun loses the tug-of-war with the planets. The one ex
A binary prefix is a unit prefix for multiples of units in data processing, data transmission, digital information, notably the bit and the byte, to indicate multiplication by a power of 2. The computer industry has used the units kilobyte and gigabyte, the corresponding symbols KB, MB, GB, in at least two different measurement systems. In citations of main memory capacity, gigabyte customarily means 1073741824 bytes; as this is a power of 1024, 1024 is a power of two, this usage is referred to as a binary measurement. In most other contexts, the industry uses the multipliers kilo, giga, etc. in a manner consistent with their meaning in the International System of Units, namely as powers of 1000. For example, a 500 gigabyte hard disk holds 500000000000 bytes, a 1 Gbit/s Ethernet connection transfers data at 1000000000 bit/s. In contrast with the binary prefix usage, this use is described as a decimal prefix, as 1000 is a power of 10; the use of the same unit prefixes with two different meanings has caused confusion.
Starting around 1998, the International Electrotechnical Commission and several other standards and trade organizations addressed the ambiguity by publishing standards and recommendations for a set of binary prefixes that refer to powers of 1024. Accordingly, the US National Institute of Standards and Technology requires that SI prefixes only be used in the decimal sense: kilobyte and megabyte denote one thousand bytes and one million bytes while new terms such as kibibyte and gibibyte, having the symbols KiB, MiB, GiB, denote 1024 bytes, 1048576 bytes, 1073741824 bytes, respectively. In 2008, the IEC prefixes were incorporated into the international standard system of units used alongside the International System of Quantities. Early computers used one of two addressing methods to access the system memory. For example, the IBM 701 used binary and could address 2048 words of 36 bits each, while the IBM 702 used decimal and could address ten thousand 7-bit words. By the mid-1960s, binary addressing had become the standard architecture in most computer designs, main memory sizes were most powers of two.
This is the most natural configuration for memory, as all combinations of their address lines map to a valid address, allowing easy aggregation into a larger block of memory with contiguous addresses. Early computer system documentation would specify the memory size with an exact number such as 4096, 8192, or 16384 words of storage; these are all powers of two, furthermore are small multiples of 210, or 1024. As storage capacities increased, several different methods were developed to abbreviate these quantities; the method most used today uses prefixes such as kilo, mega and corresponding symbols K, M, G, which the computer industry adopted from the metric system. The prefixes kilo- and mega-, meaning 1000 and 1000000 were used in the electronics industry before World War II. Along with giga- or G-, meaning 1000000000, they are now known as SI prefixes after the International System of Units, introduced in 1960 to formalize aspects of the metric system; the International System of Units does not define units for digital information but notes that the SI prefixes may be applied outside the contexts where base units or derived units would be used.
But as computer main memory in a binary-addressed system is manufactured in sizes that were expressed as multiples of 1024, when applied to computer memory, came to be used to mean 1024 bytes instead of 1000. This usage is not consistent with the SI. Compliance with the SI requires that the prefixes take their 1000-based meaning, that they are not to be used as placeholders for other numbers, like 1024; the use of K in the binary sense as in a "32K core" meaning 32 × 1024 words, i.e. 32768 words, can be found as early as 1959. Gene Amdahl's seminal 1964 article on IBM System/360 used "1K" to mean 1024; this style was used by other computer vendors, the CDC 7600 System Description made extensive use of K as 1024. Thus the first binary prefix was born. Another style was to truncate the last three digits and append K using K as a decimal prefix similar to SI, but always truncating to the next lower whole number instead of rounding to the nearest; the exact values 32768 words, 65536 words and 131072 words would be described as "32K", "65K" and "131K".
This style was used from about 1965 to 1975. These two styles were used loosely around the same time, sometimes by the same company. In discussions of binary-addressed memories, the exact size was evident from context; the HP 21MX real-time computer denoted 196608 as "196K" and 1048576 as "1M", while the HP 3000 business computer could have "64K", "96K", or "128K" bytes of memory. The "truncation" method waned. Capitalization of the letter K became the de facto standard for binary notation, although this could not be extended to higher powers, use of the lowercase k did persist; the practice of using the SI-inspired "kilo" to indicate 1024 was extended to "megabyte" meaning 10242 bytes, "gigabyte" for 10243 bytes. For example, a "512 megabyte" RAM module is 512×10242 bytes, rather than 512000000; the symbols Kbit, Kbyte and Mbyte started to be used as "binary units"—"bit" or "
Finger binary is a system for counting and displaying binary numbers on the fingers of one or more hands. It is possible to count from 0 to 31 using the fingers of a single hand, from 0 through 1023 if both hands are used, or from 0 to 1048573 if the toes on both feet are used as well. In the binary number system, each numerical digit has two possible states and each successive digit represents an increasing power of two. Note: What follows is but one of several possible schemes for assigning the values 1, 2, 4, 8, 16, etc. to fingers, not the best.: The rightmost digit represents two to the zeroth power. It is possible to use anatomical digits to represent numerical digits by using a raised finger to represent a binary digit in the "1" state and a lowered finger to represent it in the "0" state; each successive finger represents a higher power of two. With palms oriented toward the counter's face, the values for when only the right hand is used are: When only the left hand is used: When both hands are used: And, with the palms oriented away from the counter: The values of each raised finger are added together to arrive at a total number.
In the one-handed version, all fingers raised is thus 31, all fingers lowered is 0. In the two-handed system, all fingers raised is 1,023 and two fists represents 0, it is possible to have each hand represent an independent number between 0 and 31. When used in addition to the right. Just as fractional and negative numbers can be represented in binary, they can be represented in finger binary. Representing negative numbers is simple, by using the leftmost finger as a sign bit: raised means the number is negative, in a sign-magnitude system. Anywhere between -511 and +511 can be represented this way. Note that, in this system, both a positive and a negative zero may be represented. If a convention were reached on palm up/palm down or fingers pointing up/down representing positive/negative, you could maintain 210 - 1 in both positive and negative numbers. There are multiple ways of representing fractions in finger binary. Fractions can be stored natively in a binary format by having each finger represent a fractional power of two: 1 2 x.
Using the left hand only: Using two hands: The total is calculated by adding all the values in the same way as regular finger binary dividing by the largest fractional power being used, simplifying the fraction as necessary. For example, with thumb and index finger raised on the left hand and no fingers raised on the right hand, this is /1024 = 768/1024 = 3/4. If using only one hand, it would be /32 = 24/32 = 3/4 also; the simplification process can itself be simplified by performing a bit shift operation: all digits to the right of the rightmost raised finger are discarded and the rightmost raised finger is treated as the ones digit. The digits are added together using their now-shifted values to determine the numerator and the rightmost finger's original value is used to determine the denominator. For instance, if the thumb and index finger on the left hand are the only raised digits, the rightmost raised finger becomes "1"; the thumb, to its immediate left, is now the 2s digit. The index finger's original value determines the denominator: the result is 3/4.
Combined integer and fractional values can be represented by setting a radix point somewhere between two fingers. All digits to the left of the radix point are integers. Dyadic fractions, explained above have limited use in a society based around decimal figures. A simple non-dyadic fraction such as 1/3 can be approximated as 341/1024, but the conversion between dyadic and decimal or vulgar forms is complicated. Instead, either decimal or vulgar fractions can be represented natively in finger binary. Decimal fractions can be represented by using regular integer binary methods and dividing the result by 10, 100, 1000, or some other power of ten. Numbers between 0 and 102.3, 10.23, 1.023, etc. can be represented this way, in increments of 0.1, 0.01, 0.001, etc. Vulgar fractions can be represented by using one hand to represent the numerator and one hand to represent the denominator. In theory, it is possible to use other positions of the fingers to represent more than two states; this would make it possible to count up to 59,048 on two hands.
In practice, many people will find it difficult to hold all f
A binary asteroid is a system of two asteroids orbiting their common barycenter. The binary nature of 243 Ida was discovered when the Galileo spacecraft flew by the asteroid in 1993. Since numerous binary asteroids and several triple asteroids have been detected; the mass ratio of the two components – called the "primary" and "secondary" of a binary system – is an important characteristic. Most binary asteroids have a large mass ratio, i.e. a small satellite in orbit around the main component. Systems with a small minor-planet moon – called "companion" or "satellite" – include 87 Sylvia, 107 Camilla, 45 Eugenia, 121 Hermione, 130 Elektra, 22 Kalliope, 283 Emma, 379 Huenna and 243 Ida; some binary systems have a mass ratio near unity. They include 90 Antiope, 2006 VW139, 2017 YE5 and 69230 Hermes, with average component diameters of 86, 1.8, 0.9 and 0.8 km, respectively. Several theories have been posited to explain the formation of binary-asteroid systems. Many systems have significant macro-porosity.
The satellites orbiting large main-belt asteroids such as 22 Kalliope, 45 Eugenia or 87 Sylvia may have formed by disruption of a parent body after impact or fission after an oblique impact. Trans-Neptunian binaries may have formed during the formation of the Solar System by mutual capture or three-body interaction. Near-Earth asteroids, which orbit in the inner part of the Solar System, most form by spin-up and mass shedding as a result of the YORP effect. Numerical simulations suggest that when solar energy spins a “rubble pile” asteroid to a sufficiently fast rate by the YORP effect, material is thrown from the asteroid's equator; this process exposes fresh material at the poles of the asteroid. Minor-planet moon § List of minor planets with moons Subsatellite known as Moonmoon – A satellite that orbits a natural satellite Contact binary Triple asteroids 2001 SN263 and 1994 CC
In computing, executable code or an executable file or executable program, sometimes referred to as an executable, causes a computer "to perform indicated tasks according to encoded instructions," as opposed to a data file that must be parsed by a program to be meaningful. The exact interpretation depends upon the use - while "instructions" is traditionally taken to mean machine code instructions for a physical CPU, in some contexts a file containing bytecode or scripting language instructions may be considered executable. Executable files can be hand-coded in machine language, although it is far more convenient to develop software as source code in a high-level language that can be understood by humans. In some cases, source code might be specified in assembly language instead, which remains human-readable while being associated with machine code instructions; the high-level language is compiled into either an executable machine code file or a non-executable machine-code object file of some sort.
Several object files are linked to create the executable. Object files, executable or not, are in a container format, such as Executable and Linkable Format; this structures the generated machine code, for example dividing it into sections such as the.text.data, and.rodata. In order to be executed by the system, an executable file must conform to the system's application binary interface. Most a file is executed by loading the file into memory and jumping to the start of the address space and executing from there, but in more complicated interfaces executable files have additional metadata, specifying a separate entry point. For example, in ELF, the entry point is specified in the header in the e_entry field, which specifies the memory address at which to start execution. In the GCC this field is set by the linker based on the _start symbol. Executable files also include a runtime system, which implements runtime language features and interactions with the operating system, notably passing arguments and returning an exit status, together with other startup and shutdown features such as releasing resources like file handles.
For C, this is done by linking in the crt0 object, which contains the actual entry point and does setup and shutdown by calling the runtime library. Executable files thus contain significant additional machine code beyond that directly generated from the specific source code. In some cases it is desirable to omit this, for example for embedded systems development or to understand how compilation and loading work. In C this can be done by omitting the usual runtime, instead explicitly specifying a linker script, which generates the entry point and handles startup and shutdown, such as calling main to start and returning exit status to kernel at end. Comparison of executable file formats EXE File Format at What Is
A binary star is a star system consisting of two stars orbiting around their common barycenter. Systems of two or more stars are called multiple star systems; these systems when more distant appear to the unaided eye as a single point of light, are revealed as multiple by other means. Research over the last two centuries suggests that half or more of visible stars are part of multiple star systems; the term double star is used synonymously with binary star. Optical doubles are so called because the two stars appear close together in the sky as seen from the Earth, their "doubleness" depends only on this optical effect. A double star can be revealed as optical by means of differences in their parallax measurements, proper motions, or radial velocities. Most known double stars have not been studied adequately to determine whether they are optical doubles or doubles physically bound through gravitation into a multiple star system. Binary star systems are important in astrophysics because calculations of their orbits allow the masses of their component stars to be directly determined, which in turn allows other stellar parameters, such as radius and density, to be indirectly estimated.
This determines an empirical mass-luminosity relationship from which the masses of single stars can be estimated. Binary stars are detected optically, in which case they are called visual binaries. Many visual binaries have long orbital periods of several centuries or millennia and therefore have orbits which are uncertain or poorly known, they may be detected by indirect techniques, such as spectroscopy or astrometry. If a binary star happens to orbit in a plane along our line of sight, its components will eclipse and transit each other. If components in binary star systems are close enough they can gravitationally distort their mutual outer stellar atmospheres. In some cases, these close binary systems can exchange mass, which may bring their evolution to stages that single stars cannot attain. Examples of binaries are Sirius, Cygnus X-1. Binary stars are common as the nuclei of many planetary nebulae, are the progenitors of both novae and type Ia supernovae; the term binary was first used in this context by Sir William Herschel in 1802, when he wrote: If, on the contrary, two stars should be situated near each other, at the same time so far insulated as not to be materially affected by the attractions of neighbouring stars, they will compose a separate system, remain united by the bond of their own mutual gravitation towards each other.
This should be called a real double star. By the modern definition, the term binary star is restricted to pairs of stars which revolve around a common center of mass. Binary stars which can be resolved with a telescope or interferometric methods are known as visual binaries. For most of the known visual binary stars one whole revolution has not been observed yet, they are observed to have travelled along a curved path or a partial arc; the more general term double star is used for pairs of stars which are seen to be close together in the sky. This distinction is made in languages other than English. Double stars may be binary systems or may be two stars that appear to be close together in the sky but have vastly different true distances from the Sun; the latter are termed optical optical pairs. Since the invention of the telescope, many pairs of double stars have been found. Early examples include Acrux. Mizar, in the Big Dipper, was observed to be double by Giovanni Battista Riccioli in 1650; the bright southern star Acrux, in the Southern Cross, was discovered to be double by Father Fontenay in 1685.
John Michell was the first to suggest that double stars might be physically attached to each other when he argued in 1767 that the probability that a double star was due to a chance alignment was small. William Herschel began observing double stars in 1779 and soon thereafter published catalogs of about 700 double stars. By 1803, he had observed changes in the relative positions in a number of double stars over the course of 25 years, concluded that they must be binary systems. Since this time, many more double stars have been measured; the Washington Double Star Catalog, a database of visual double stars compiled by the United States Naval Observatory, contains over 100,000 pairs of double stars, including optical doubles as well as binary stars. Orbits are known for only a few thousand of these double stars, most have not been ascertained to be either true binaries or optical double stars; this can be determined by observing the relative motion of the pairs. If the motion is part of an orbit, or if the stars have similar radial velocities and the difference in their proper motions is small compared to their common proper motion, the pair is physical.
One of the tasks that remains for visual observers of double stars is to obtain sufficient observations to prove or disprove gravitational connection. Binary stars are classified into four types accordi