Posts

Templates in C++

C++ supports a mechanism known as template to implement the concept of generic programming . Templates allows us to generate a family of classes or a family of functions to handle different types. Template classes and functions eliminate code duplication for different types and thus make the program development easier and more manageable. We can use multiple parameters in both the class templates and function templates. A specific class created from a class template is called a template class and the process of creating a template class is known as instantiation. Similarly, a specific function created from a function template is called a template function. Like other functions, template functions can be overloaded. Member functions of a class template must be defined as function templates using the parameters of the class template. We may also use non - type parameters such basic or derived data types as arguments templates.

Congestion in networking

What is congestion? Congestion is traffic. Interference of two or more packets . Reasons:-  Sending packets the same time. Definition:  Congestion is a situation in which number of packets in network is greater than capacity of network or channel. Total load > Capacity of channel  , is the main reason of congestion Effect of congestion :- Two main factors are affected by congestion 1) Delay versus load. 2) Throughput versus load. When load is less than network capacity delay is permission and vice versa . Delay depends on propagation delay and transmission delay . propagation time , transmission time, buffer time Congestion is directly  proportional to Delay and Congestion is directly proportional to Load Throughput:- Number of packets successfully delivered is called throughput . Throughput is inversely proportional to congestion When less congestion all packets will be successfully delivered means high throughput. causes of congestion : If...