Posts

Data Structures : Linear List

Introduction Data Structure     A Data Structure is a named group of data of different data types which is stored in a specific way and can be processed as a single unit. A data structure has well-defined operations, behavior and properties.  Different Data structures  Data structures are very important in a computer system, as these not only allow the users to combine various data types in a group but also allow processing of the group as a single unit thereby making things much simpler and easier.  The data structures can be classified into two  types:   1. Simple Data Structures : These data structures are normally built from primitive data types like integers, characters, boolean etc. For example:- Arrays, Linear lists. 2. Compound Data Structures : Simple data structures can be used in various ways to form more complex structures called compound data structures. Compound data structures are classified into following two types:- Line...

File pointers and random access

Image
Introduction Every file maintains two pointers called get_pointer (in input mode file) and   put_pointer (in output mode file) which tell the current position in  the file where writing or reading will take place. These pointers help attain random access in file. That means moving directly to any location in the file instead of moving through it sequentially. There may be situations where random  access is the best choice. For example, if you have to modify a value in record no. 21 and then using a random access techniques, you can place the file pointer at the beginning of record 21 and then straightway process the record. If sequential access is used, then you'll have to unnecessarily go through first twenty records in order to reach at record 21. Functions used for random access In C++, random access is achieved by manipulating seekg(), seekp(), tellg() and   tellp()  functions.  The seekg() and tellg() functions allow you to set and examine ...

Inheritance and its forms

Image
  Need Of Inheritance Inheritance is a splendid concept of object oriented-languages. There are several reasons why inheritance was introduces into object oriented language. Here are some major reasons behind the introduction of inheritance. One major reason behind this is capability to express the inheritance relationship which ensures the closeness with the real-world models. Another reason is the idea of reusability . The advantages of reusability are : faster development time, easier maintenance, and easy to extend. Inheritance allows the addition of additional features to an existing class without modifying it. One can derive a new class ( subclass or   derived class ) from an existing one and add new features to it. For example, Suppose we have a class   Student, and we need to add a new class called GraduateStudent . We derive the new class G raduateStudent  from the existing class Student  and then all we need to add are the extra features to ...

Everything about programming

Image
In our day to day life we come across different type of technologies such as token vending machines, automatic doors, speech recognition etc. Did you ever wonder how these things are being possible? Such services which we use everyday have been created by people writing computer programs. When you learn something new, it may seem challenging initially. Same is in the case of programming. Initially it seems intimidating but it gets easier over time. This blog post will help you to know everything about it. Enjoy!            What Is Programming? Simply speaking, programming means giving instructions or commands to the computer which tells it how to perform a task. You can think of programming as communication between humans and machines with the help of programs.    Computer Program:- A computer program is a sequence of instructions written using a Programming Language  to perform a specified task by the computer.  Programming :-   P...