Skip to main content

Posts

Showing posts from August, 2011

Interview Questions

Problems on search/ sort --------------------------- Q. Design an algorithm to find the duplicates in an array. Given an array of random integers, write an algorithm in C that removes duplicated numbers and return the unique numbers in the original array. E.g Input: {4, 8, 4, 1, 1, 2, 9} Output: {4, 8, 1, 2, 9, ?, ?} void rmdup(int *array, int length){ int *current , *end = array + length - 1; for ( current = array + 1; array < end; array++, current = array + 1 ){   while ( current < end ){     if ( *current == *array ){         *current = *end--;     }     else{         current++;     }  }// while ends ... } // for ends ... } // func ends ===================== Q. Given an array of length N containing integers between 1 to Nm determine if it contains any duplicates. How can we efficiently find out if any of those numbers are duplicates ? To know only The easiest approach is to make a hash table to keep track of the numbers we've seen so far. Somet

SGSN/GGSN (GPRS)

================= The 3GPP architecture for data enhances the 2.5-generation General Packet Radio Service model, an intermediate step for transporting data over GSM networks. Two new nodes are defined in GPRS: the serving-GPRS support node (SGSN) and the gateway-GPRS support node (GGSN). The SGSN is at the same level as the mobile switching center, in that it interfaces to the "data" world in the same way that the mobile switching center interfaces to the circuit-switched PSTN (public switched telephone network). The GGSN, meanwhile, communicates with the SGSN to transport the data packets to and from external IP networks, such as the Internet. For data traffic, the radio-access network (RAN) node communicates with the SGSN, which transfers the IP datagrams from the mobile station or node inside GPRS Tunneling Protocol (GTP) packets. GTP runs over UDP/IP and is used for communication between the SGSN and the GGSN, as well as between the RAN and the SGSN. The SGSNs and GGSNs