Posts

Introduction to Data structures

Data Structures A  data structure  is a particular way of storing and organizing  data  in a computer so that it can be used  efficiently.  Data structures provide a means to manage huge amounts of data efficiently, such as large  databases  and  internet indexing services . Usually, efficient data structures are a key to designing efficient  algorithms. An algorithm is a step by step solution of any given problem at hand in a finite number of steps. There are two types of data structures(broadly): 1. Linear Data Structures and 2. Non-Linear Data Structures Linear Data Structures:- Linear Data Structures are  stored in computer's memory in sequential way i.e., one after the other. There are following Linear Data Structures: 1. Array 2. Stack 3. Queue None-Linear Data Structures:- None-Linear Data Structures are not  stored in computer's memory in sequential way i.e., one after the other. There are following none-Linear Data Structures: 1. Linked List 2. Tree 3.

Inheritence

Inheritence: In object-oriented programming (OOP), inheritance is a way to reuse code of existing objects, or to establish a subtype from an existing object, or both, depending upon programming language support. In classical inheritance where objects are defined by classes , classes can inherit attributes and behavior from pre-existing classes called base classes , superclasses , parent classes or ancestor classes . The resulting classes are known as derived classes , subclasses or child classes . The relationships of classes through inheritance gives rise to a hierarchy . In prototype-based programming , objects can be defined directly from other objects without the need to define any classes, in which case this feature is called differential inheritance

Constructors and Destructors

Constructors and Destructors Objects generally need to initialize variables or assign dynamic memory during their process of creation to become operative and to avoid returning unexpected values during their execution. For example, what would happen if in the previous example we called the member function area() before having called function set_values() ? Probably we would have gotten an undetermined result since the members x and y would have never been assigned a value. In order to avoid that, a class can include a special function called constructor , which is automatically called whenever a new object of this class is created. This constructor function must have the same name as the class, and cannot have any return type; not even void . We are going to implement CRectangle including a constructor: // example: class constructor #include <iostream.h> class CRectangle { int width, height; public : CRectangle ( int , int );//Parameterized Cons

Introduction to Classes in C++

Class : A class is an extension to the structure Data Type: instead of holding only data, it can hold both data and functions. An object is an instantiation of a class. In terms of variables, a class would be the type, and an object would be the variable. Classes are generally declared using the keyword class , with the following Syntax: class class_name { access_specifier_1: member1; access_specifier_2: member2; ... } object_names;//This is optional Where class_name is a valid identifier for the class, object_names is an optional list of names for objects of this class. The body of the declaration can contain members, that can be either data or function declarations, and optionally access specifiers. All is very similar to the declaration of a structure, except that we can now include also functions and members, but also this new thing called access specifier . An access specifier is one of the following three keywords: private , public or prot

network protocols

1.       The Internet Protocol (IP) is the principal communications protocol used for relaying datagrams (also known as network packets ) across an internetwork using the Internet Protocol Suite . Responsible for routing packets across network boundaries, it is the primary protocol that establishes the Internet . 2.       Wi-Fi is a popular technology that allows an electronic device to exchange data wirelessly (using radio waves ) over a computer network , including high-speed Internet connections. Wi-Fi as any " wireless local area network (WLAN) products that are based on the Institute of Electrical and Electronics Engineers' (IEEE) 802.11 standards". A device that can use Wi-Fi (such as a personal computer, video game console, smartphone , tablet , or digital audio player) can connect to a network resource such as the Internet via a wireless network access point . Such an access point (or hotspot ) has a range of about 20 meters (65 feet) indoors and a

Network Protocols

Network Protocols 1.       IMAP: The Internet Message Access Protocol (commonly known as IMAP) is an Application Layer Internet protocol that allows an e-mail client to access e-mail on a remote mail server . IMAP supports both on-line and off-line modes of operation. E-mail clients using IMAP generally leave messages on the server until the user explicitly deletes them. IMAP offers access to the mail storage. Clients may store local copies of the messages, but these are considered to be a temporary cache. 2.       Simple Mail Transfer Protocol ( SMTP ): is an Internet standard for electronic mail (e-mail) transmission across Internet Protocol (IP) networks. SMTP is a connection-oriented , text-based protocol in which a mail sender communicates with a mail receiver by issuing command strings and supplying necessary data over a reliable ordered data stream channel, typically a Transmission Control Protocol (TCP) connection. An SMTP session consists of commands origin

Network Topologies

Image
Network Topologies The structure of a network including physical arrangement of devices is known as network topology. Consider the following types of topologies:\ 1.       Bus topology 2.       Star topology 3.       Tree topology 4.       Point-to-Point 5.       Mesh 6.       Ring 7.       Hybrid Bus Topology: The type of network topology in which all of the nodes of the network are connected to a common transmission medium which has exactly two endpoints all data that is transmitted between nodes in the network is transmitted over this common transmission medium and is able to be received by all nodes in the network simultaneously. Consider the following figure-   Advantages of bus topology: Short Cable Length. Easy to expand. Simple Architecture. Disadvantages: Fault diagnosis is difficult. Star Topology: In a star topology, each network host is connected to a central hub with a point-to-point connection. All of the nodes on the ne