24/03/2016

Differences between data structures and algorithms?

Algorithms are like verbs and data structures are like nouns. An algorithm is just a method for doing something on a computer; a data structure is a layout for memory that represents some sort of data.

If you wanted to store thousands of English words along with their meanings in a way that you could later look them up whenever you needed, you could do that in multiple ways. Consider two:

  1. Write them down in any order.
  2. Write them down alphabetically.

You can see  how it is advantageous to do it as 2. Not surprisingly, that's how dictionaries are arranged. So a dictionary is a data structure: it has both data AND a structure especially suitable for performing some action on that data (in this case, looking up words).

Now once you have the dictionary, how do you look a word up? Possibly like this:

  1. Open the dictionary roughly at the page where you think your word would be.
  2. Flip a few(or maybe many) pages back or forth depending on where you've landed in step 1.
  3. Scan page to find your word.
  4. Read the entry next to the word.

This sequence of actions you take to look up a word is an algorithm: a general description of how to do something (in this case, looking up words), usually with the data from your data structure. This algorithm (let's call it LOOKUP) does not need to have the exact 4 steps I listed above. It could be anything as long as there is a sequence of steps that lead you unambiguously to the desired result. Because that is the primary purpose of algorithms: to make actionable knowledge portable. You are now free to compile your own dictionary of words from any language and send it over to me. If you've compiled it alphabetically and I know the alphabet order for that language (necessary for step 1 of algorithm), I can use your dictionary to look up words all day long without your help. 

So data structures and algorithms work together to let you do stuff with your data. Data structure is where the structured data is, algorithm is how you do with it whatever it is you want to do. Notice that the design of the algorithm is guided by the data structure it will work on. The algorithm can only have actions licensed by the data structure it operates upon. Step 1 from our algorithm LOOKUP works only because the dictionary is arranged alphabetically - were it not, you wouldn't know where to open it. You would have to go through it page by page to look a word up. In fact, this is also an algorithm (Brute-force search) but it is not a very good one, is it? The fact that our data structure has a, well, structure helps us use a much faster algorithm (LOOKUP) to look for a word.

Now that I've mentioned speed, it might be interesting to think of how we can make our algorithm LOOKUP work faster (since that's what you almost always want). I believe by now you can see there are two things we could tweak to gain speed - the algorithm itself, as well as the data structure. Look at step 1 again. Can this be done faster? Yes. The letter S has the most words, followed by P, C, D, M etc. If you have some idea of the relative number of words per alphabet you can make a better guess about where to open a dictionary. This in turn will make step 2 faster (on average) because if you land in the vicinity of a target word more accurately, you need to flip fewer pages correcting for it later. Similarly, step 3 can become faster if you use the guide words at the top margin of every page. 

The other way is to modify the data structure itself. You've probably seen dictionaries like this:

   
The notches, or tabs, let you immediately open the dictionary in the general area of a letter. This makes step 1 of our algorithm faster without us having to explicitly modify the algorithm. In essence, the basic idea is to inform either the algorithm or the data structure better to make the entire operation faster.

12/03/2016

Amazon Prime Air - drone delivery


Amazon already offers delivery in some markets in as little as one hour with Amazon Prime Now, but that still relies upon humans driving cars. How quaint. Amazon’s next big idea is the deploy an army of drones to deliver packages over a wide area in as little as 30 minutes. Prime Air was unveiled as a concept several years ago, but Amazon is still developing it. Amazon exec Paul Misener has revealed more details about how Prime Air will work in an interview with Yahoo Tech.

Amazon thinks that in order to get delivery times to half an hour, the drones will need to have a range of about 10 miles. That probably means areas with Prime Now warehouses will serve as hubs for the drones. The drones themselves will weight about 55 pounds and have a maximum payload of five pounds. So, that giant TV you ordered will probably still make its way to you on a truck. Still, most things Amazon sells weight less than five pounds. Misener doesn’t know if it’s going to cost anything extra, though.

Amazon has yet to come up with a good way to deliver to those in apartments, but if you live in a house, the drone will just drop the package on your doorstep. If your yard has lots of obstacles, that’s no problem, according to Misener. He compares Amazon’s drones to horses as opposed to cars, which makes more sense than you’d expect. A car will go wherever you steer it, even if you steer it into the tree in your front yard. A horse, on the other hand, will go around the tree because it prefers not to run into things. The drones will be the same — they can avoid obstacles even if an operator steers it into one.

06/08/2013

New Firefox Operating System


Getting Started with Firefox OS

Firefox OS is Mozilla's open source mobile operating system built on web standards.

Overview

Mozilla is partnered with a number of carriers and OEMs in the development of Firefox OS, to bring devices to emerging mobile markets in 2013.
The Firefox OS Developer Preview is a release in collaboration with Telefonica and Geeksphone for the following devices:

gp_small



Firefox OS v1.01 is supported on two devices, as follows:

zte_small



tcl_small


Supported devices provide all of the features you would expect from a smartphone, like email, SMS messaging, search, maps and GPS navigation, music player, FM radio, camera, Facebook and Twitter. Check the notification bar at the top for notifications, connectivity, battery life and clock.

quick_nav_bar

Organize your most-used apps in a simple tray on the bottom of your home page for quick access to browsing, email, calendars and contacts.

Browser on Firefox OS

Of course, you'll enjoy the world-class Firefox browser and Firefox Marketplace marketplace for games and entertainment, social apps, weather and local content on your phone.
Tap and hold the home button to close and switch running apps.

App Manager

Pull the utility tray down from the top of your phone for quick access to WiFi, Data, Bluetooth, Airplane mode & Settings.

enable_data


Firefox OS even has dynamic app search offered by no other mobile OS. It enables you to search for anything on the web and run it as an app on your phone without even downloading it!

mitchell_app

If you find an app you like, just tap the bookmark star in the bottom navigation bar.

app_nav_bar


Firefox OS enables you to customize all of its system features to your preferences in the following Settings:

setting1

setting2

setting3

setting4

Use the Help to access this user guide on your phone. You can search all of the help articles in your language or ask a question of our community of experts.

help!

Mozillians are here to help you learn Firefox OS.

help_others

We'll show you how fun it is to join our great community of support contributors!

Syncing contacts between phones and importing Facebook friends

Scheduling activities

Organize your busy professional and personal activities using scheduling tools synced with your social network or your professional schedule.

Using SMS

Multi-tasking

Use productive and quick multi-tasking features.

Setting up Email

Downloading apps

Camera

Going online (connecting to Wi-fi)

Notifications

Navigation and maps

Silence Mode

Battery saving options

For commuting, the interface is designed to have a clear indication of when the battery needs charging, and how much battery is left. Battery saving options are enabled with the use of Airplane mode and by enabling auto-adjust of brightness and screen saving in the Display settings.

Listening to the radio and music player

Playing games with friends in-person with connected devices

Enhance social moments through connecting devices in-person. Firefox OS provides the ability to play games or share content together in-person by using Bluetooth.

Customize controls and options on Firefox OS

It is easy and fun to customize your Firefox phone to your lifestyle using these helpful articles.

Controlling data and credits

The interface is designed so that data can be turned on and off with confidence. Across all data and communication services, Firefox OS phones provide a level of credit clarity and reassurance, and simple data plans as an option from your carrier.

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Best Web Host