Data Structure interview questions


21. What is Abstract data type?
An abstract data type (ADT) is a mathematical model for data types, where a data type is defined by its behavior (semantics) from the point of view of a user of the data, specifically in terms of possible values, possible operations on data of this type, and the behavior of these operations.The abstract datatype is special kind of datatype, whose behavior is defined by a set of values and set of operations
ADT consists of two parts
1) Values definition
2) Operation definition

22. What are the different types of Queue?
There are four types of Queue:
Simple Queue
Circular Queue
Priority Queue
Dequeue (Double Ended Queue)

23. What is a priority queue?
In computer science, a priority queue is an abstract data type which is like a regular queue or stack data structure, but where additionally each element has a “priority” associated with it. In a priority queue, an element with high priority is served before an element with low priority.
i) Ascending priority queue- Here smallest item can be removed : (insertion is arbitrary)
ii) Descending priority queue- Here largest item can be removed : (insertion is arbitrary)

24.What is a circular queue?
A circular buffer, circular queue, cyclic buffer or ring buffer is a data structure that uses a single, fixed-size buffer as if it were connected end-to-end. This structure lends itself easily to buffering data streams.

25.What is a double-ended queue ?
In computer science, a double-ended queue is an abstract data type that generalizes a queue, for which elements can be added to or removed from either the front or back. It is also often called a head-tail linked list, though properly this refers to a specific data structure implementation of a deque.

Author: user

Leave a Reply