Society & Culture & Entertainment Hobbies & Science

Binary Vs. Binary Trees

    Binary Computing

    • Binary numbers and data are important to computer theory because modern electronic computers are elaborate sets of on-off switches. The computer cannot directly represent the number “57” but it easily handles its binary, or base-2 equivalent, 111001, where an electrical “on” state is a one and “off” is a zero. Once converted to binary, a computer can perform arithmetic on it and compare it to other numbers.

    Binary Data

    • A computer represents all data, not just numbers, as strings of on-off binary digits. It handles letters and words, for example, by translating them into binary codes, where a code of eight binary digits can represent any letter, including capitals, plus special characters such as spaces, ampersands and the like. The word “and,” for example, requires 24 binary digits: three letters of eight digits each. Though the computer does not do arithmetic on letters, it compares characters to sort a list of names alphabetically, for example.

    Binary Tree

    • A binary tree is simply a way to organize a list of things. If you diagram a binary tree on a sheet of paper, you have something that looks like an odd sort of family genealogy. The binary tree begins with a single parent, who has at most two children. Each child, or “leaf”on the tree, also has at most two children. Therefore, every child has exactly one direct parent, and at most one direct sibling. Properly sorted, a binary tree speeds up a search for items in a list.

    Binary Search

    • One of the most critical tasks computers perform is finding things rapidly. For example, a bank teller keys in a customer account number into a computer terminal. The bank may have a file with 2 million customers, but the computer doesn’t have to read all the customers until it finds the right one; it organizes the customer numbers into a sorted binary tree. It reads the top member, or node, and asks, “Is this the account number? If it is, get the record. If not, is it greater than the account number? If not, take the left branch on the tree, and examine that node. If it is, take the right branch and look at the node. By zig-zagging down the binary tree, the computer finds a match in a fraction of the time it would take to look through each record, one after the other.

Related posts "Society & Culture & Entertainment : Hobbies & Science"

How Does a Steam Turbine Work?

Hobbies & Science

Good Ways to Get Autographs

Hobbies & Science

How to Make a Keychain With Plasic Strings

Hobbies & Science

Weather Changes Caused by Earth's Polarity Change

Hobbies & Science

How to Mold Sterling Silver

Hobbies & Science

Redox Explained

Hobbies & Science

How to Design a Ferrite Core Toroidal Transformer

Hobbies & Science

Dust Removal From PS3

Hobbies & Science

How to Cover Wire Hangers

Hobbies & Science

Leave a Comment