Category Archives: Data Structures

Dangerous String

A string contains ‘0’ and ‘1’.You have to find out whether the string is dangerous or not. The string will be dangerous in the following two conditions. There are at least 7 continuous occurrences of ‘1’. There are at least 7 continuous occurrences of ‘0’. Examples: Input : 1000000001 Output : YES Explanation: It has more than 7… Read More »

Why to Learn Data Structure and Algorithms ?

Programming is all about data structures and algorithms. Data structures are used to hold data while algorithms are used to solve the problem using that data. Data structures and algorithms (DSA) goes through solutions to standard problems in detail and gives you an insight into how efficient it is to use each one of them. It also teaches… Read More »

Introduction of Array Data Structure

Array is collection of items having same data type stored in contiguous memory location. An array is derived data type in C programming language which can store similar types of data in contiguous memory locations. Data may be primitive type, (i.e., int, char, float, double), address of union, structure, pointer, function or another array. Array implementation is important… Read More »

Introduction of Queue Data Structure

Queue is an ordered list in which all insertions at one end called REAR and deletions are made at another end called FRONT. Queues are sometimes referred to as First In First Out (FIFO) list. Examples of Queue: People waiting in line at the bank queue counter from a queue. In computer, the jobs waiting in line to… Read More »

C Variables and its properties

Prerequisite – Introduction to C programming language, Variables in C Variable is named location of data. In other words, variable is container of data. In real world we have used various type containers for specific purpose. For example, we have used suitcase to store clothes, match box to store match sticks etc. In the same way, variable of… Read More »