Friday, October 27, 2006

Multi-dimensional arrays and the importance of arrangement

When I wrote about the lockers, I mentioned that the row of lockers was similar to a single dimension array. So, I guess it behooves me[I love to use words like behooves -makes my nose go up in the air, on its own accord ;^)] to talk about some array that has more than a single dimension. As people living in a 3D world, we are all quite comfortable with 2D and 3D but not quite as much with more than 3D [unless we are a theoritical physicists with a penchant for string theory] and hence I believe that understanding 2 dimensional and 3 dimensional arrays should be rather straight forward. But tell you what, in this article, let's not even go to 3D yet [or ever]. Let's make life simpler, and look at a 2D array.

Have you ever been to a small shoe shop? Most of them have at least an entire wall covered with pigeon holes that can hold a single shoe box each. From the floor to the roof, there are rows upon rows of pigeon holes. That entire wall and the bank of shelves there is what a 2D array looks like, and each pigeon hole is an element of that array. Basically, a 2D array is an array of arrays.

In a shoe shop near where I live, works a man, a short man, about 4ft tall on his toes. He is not very educated I think, definitely knows no programming, but nevertheless, can teach us a few things about data structures and algorithms and the importance of good data organization.

As a first step, he has built the 2D array of a shelf (with about 30 columns and 12 rows) on the wall. Then he has arranged the different makes, brands and models of shoes in such a way that each column of pigeon holes contain shoes of one brand and model. So far, so good. So, if we were to go in and ask to see a specific brand and model, he knows which column to go to.

Additionally, he has learnt from experience that the fastest selling shoes are those in sizes 6 through 8, and the next fastest moving sizes being children's sizes 3, 4, and 6. So what he has done is to keep all the shoes of sizes 6, 7, and 8 in pigeon holes that are at a convenient height for him [ in his case, rows 4 through 6]. Children sizes 3, 4, and 6 he has kept in rows 1, 2 and 3 [ for, he finds bending down to reach those shoes easier than having to use the ladder]. All other sizes, the slow moving ones, he has kept in rows 7 to 12. The little diagram below shows a section of the shelf and the arrangement of the shoes.


Finally, he has also used some judgement in assigning the various columns to the various brands and models. The more popular ones occupy columns that are closer to where he usually sits, near the entrance of the store, and the less popular ones occupy columns further inside the store.

In this way, he has ensured that he can access the most common brands, models and sizes with the least amount of effort.

Over the next few articles, lets take a leaf out of the shoe seller's book and look at ways of storing and arranging data so as to make our lives easier.

42 comments:

sundar said...

Hey what happened... u havent blogged for a long time.

AlyciaSweat said...

色情金瓶梅色情自貼色情自拍色情西洋做愛影片大奶妹做愛影片女性容易想做愛女明星做愛女上男下做愛方法女人做愛女人做愛影片女人做愛感覺女人做愛技巧女人做愛時如何令男人興奮女人和你做愛代表她愛你女人喜歡怎樣做愛女人外陰部照片及做愛姿勢照片女人想做愛的時間女人愛做愛女人按摩做愛影片女人不用套做愛如何知道她想做愛女性做愛影片女子初夜做愛有高潮女子做愛遊戲大奶妹愛做愛夫妻做愛夫妻做愛自拍夫妻做愛貼圖夫妻做愛影片夫妻做愛影片2女生做愛的圖女生做愛影片女生做愛影片第一頁女男做愛影片女優做愛女優做愛影片女同做愛技巧女同志怎麼做愛女女做愛照片女女做愛影片

剩沒底天 said...

閒暇為所有財富中最美好的財富..............................

太可怕 said...

沒有友情,人生何樂?........................................

佩怡 said...

KK777一夜激情聊天live show成人自拍貼圖自慰少婦自拍裸體圖片台灣色情成人網站情人視訊網情色留言板視訊美女免費視訊聊天室限制級極度震撼情色論壇色情特區自拍裸女貼圖潮吹性影片觀賞小穴情色片a圖片sex story性愛影片美女做愛成人色情網站性愛圖片成人情色貼圖全裸寫真集圖片走光圖女生陰毛自慰影片色情av1007成人色情聊天室女生自慰裸體照成人影音聊天台灣色情網站色情片打手槍情色天堂成人視訊聊天免費情色網站av網超性感辣妹激突成人論壇情色視訊聊天鹹濕成人網站av成人論壇免費美女視訊

王怡谷 said...

Since it is the early worm that gets eaten by the bird, sleep late.............................................

水憲妤慧 said...

Make yourself necessary to someone.......................................................

明偉誠秋 said...

以簡單的行為愉悅他人的心靈,勝過千人低頭禱告。........................................

IdellA231_Fecteau1 said...

All good things come to an end. ....................................................

琦竹 said...

朝著既定的目標走,就不會迷失。..................................................

真坤 said...

喜樂的心是健康良藥,憂傷的靈使骨枯乾。........................................

明NathanA_Schulle said...

向小善致敬,它使人生旅程較為平順。.............................................

WilmerD_Sho玉鳳 said...

如此活躍的文字, 妳好棒哦! .............................................

HaroldM22 said...

成人85 高雄視訊 土豆聊天室 無碼影片 交友 av女優 性感脫衣遊戲 脫衣影片 偷拍貼圖 聊天室小高 女女愛愛圖 免費觀看情趣影片 18禁免費 少女自拍貼片 免費影城 成人a片 情色 av色情片 一夜情 383影城 視訊聊天室 玩美女人 美女 辣妹 人妻 熟女 免費視訊 視訊聊天 a圖 寫真a片 885cc 線上成人 嘟嘟 影音視訊 自拍貼圖 找援交妹 情人聊天室 免費脫衣舞短片 av色情片 洪爺影城 大奶 sex 成人電影下載 巨乳影片 性感制服 後宮電影院(入口) 限制級 裸體0204影片 性愛免費觀賞 歐美模特兒走光

慧玲PierreJ_Good9999 said...

聰明的人喜歡猜心 雖然每次都猜對了卻失去了自己的心..................................................

廖淑凡 said...

The shortest answer is doing. ............................................................

adkinsra said...

交友嘟嘟聯誼網 性愛教學,視訊 視訊聊天交友9426 哈拉557557 視訊交友 2sex999情人視訊 台中視訊交友85cc 日本a片-aa片免費看 0941 視訊聊天 LIVE 情色遊戲 kk免費視訊聊天 高雄援交夢中情人情趣用品 柔情聊天網 台北援交,情色,hilive 玩美女人影音秀 正妹視訊gogo 免費視訊csr sex888貼片 plus 28論壇 亞洲禁果影城短片 一葉情貼圖片區 aa免費看 免費成人影片sex女優 視訊線上 aa 片試看嘟嘟 a片-免費影片 線上直播a 豆豆聊天室aio辣妹視訊 高雄南部聊天聯盟 高雄援交聊天 85cc線上aa片試看嘟嘟 aio168論壇 禁地論壇情色080成人交友 高雄美女視訊 名模自拍聊天室 ut台中聊天室 視訊內衣秀,aa 片試看 UT名模視訊交友 色美媚 youtube影片下載高雄34c妹妹援交 18禁豆豆情色視訊 aio亞洲交友愛情館 999無瑪試看圖 live173 影音視訊 live 秀-全台首創一對一免費視訊 免費色咪咪影片網,a片 免費線上成人影片一本道 a片 東京熱avdvd sex貼片網s383情色大網咖 成人論壇 0204視訊交友 gogo2sex成人情色網 0401 影音視訊聊天網 4u成人 85cc 免費影城

明英 said...

世間是非,要如水泥地般水過則乾。..................................................................

鈺苓賴 said...

要持續更新下去喲!!祝你心情愉快.............................................................

陳芳 said...

Pen and ink is wits plough. ....................................................................

恩如 said...

在莫非定律中有項笨蛋定律:「一個組織中的笨蛋,恆大於等於三分之二。」.................................................................

于庭 said...

成熟,就是有能力適應生活中的模糊。.................................................................

吳婷婷 said...

人生是故事的創造與遺忘。............................................................

家賢 said...

人生是故事的創造與遺忘。............................................................

惠萍 said...

不願彎腰撿拾一根針的人,永遠不值得一塊錢。..................................................

淑娟淑娟 said...

看著你的BLOG 好多朋友都回應 真厲害..................................................................

宛真宛真 said...

There is no key to happiness, only a ladder..................................................................

建佑建佑 said...

喜歡你的部落格,祝你愈來愈好............................................................

銘木 said...

Fancy may kill or cure...................................................

琬安琬安 said...

這不過是滑一跤,並不是死掉而爬不起來了。..................................................

吳淑芬吳淑芬 said...

有夢最美啦~~加油!元氣滿點!...............................................................

蔡苡玄 said...

你不能改變容貌~~但你可以展現笑容.................................................................

承蔡蔡芸 said...

It is easier to get than to keep it.......................................................................

家唐銘 said...

人生中最好的禮物就是屬於自己的一部份............................................................

黃子黃麗旺軒 said...

Quality is better than quantity...................................................................

偉曹琬 said...

時間就是塑造生命的材料。

怡屏 said...

成功可招引朋友,挫敗可考驗朋友......................................................................

孟謝謝謝凱謝謝謝謝 said...

你的分享很不錯.. 謝謝 ..................................................

1615 said...

No pains, no gains..................................................................

江趙雲虹趙雲虹仁昆 said...

cool blog,期待更新............................................................

华瑗泽 said...

成功可招引朋友,挫敗可考驗朋友......................................................................

SadeRa盈君iford0412 said...

想跟你說一聲加油,祝福大家每天開心............................................................