Skip to main content

Posts

Showing posts from 2012

5 Steps To Be in The Top 50 List

Hi , Um Ahmed Ghazey :D , I was Student in Faculty of Computers and Information Cairo Univ. for a while, in my first year in the faculty I had been failed in One subject out of 12 it was Math I , the matter really was a strange , I used to success with high grade , how I could tell my parents with the grade , no way I hided the matter about a month until my father asked me" what you did in the exams ?" I have no chance to lie , I told him the fact , i felt sorry for the shock , but i decided to win all my battles against the faculty not surrender for the routine. the story began from here , how can I enter the Top Fifty List , I must follow successful students steps , i started asking them about many things, and here is the conclusion of my questionnaire  : Step #1  Select Good Friends ( Team ) Teamwork is the ability to work as a group toward a common vision, even if that vision becomes extremely blurry.  ~Author Unknown the most important thing in your team is :

Recursion

Recursion is a programming technique which function calls itself , this seems strange , however it is one of the most interested and effective technique in programming. it helps you write code in less statements and provides unique conceptual frame work to solve problems. lets discus some problems to know how it works : first example Triangular Numbers : it is series like : 1,3,6,10,15,21........ etc our program should get the nth term in the series, the numbers in this series called triangular numbers due to they can be visualized as a triangle. triangular numbers fig 1 finding the nth term using a loop see this figure : loop adding 1+2+3+4 and so on code is easy  , a loop will add numbers from n to 0 like this int triangle(int n) { int total = 0; while(n > 0) // until n is 1 { total = total + n; // add n (column height) to total --n; // decrement column height } return total; } it easy enough and for sure it is fast . before we start the recursio

Hash tables

Hash tables (I) A  hash table is a data Structure that offer very fast insertion and search sometimes deletion almost in O( 1) in the best cases.   O( 1) means few machine instructions to finish the operation   Advantages of Hash Tables : fast  easy to code Disadvantages of Hash Tables :   based on Array (Array is fixed length data structure) performance may be degraded catastrophically when the table is full. no convenient way to visit item n hash table. What is hashing ? hashing means convert range of key values into range of Array index. for example : suppose you are writing a program to access  employee records in small company say 1000 employees . requirement : database used one mega byte  fastest access to any individual record employees are seldom laid off and even happen their records still exist.  every employee has been given number from 1(from the founder) to 1000 (the most recent employee ) , this employee numbers can be used as keys. we