Data Structure Basics
Data Structure Basics
FACULTY OF ENGINEERING
Department of Computer Science and
Engineering
4. Stack
A stack is an abstract data type in which all the operations will be take place in one point
called top. It works in a principle of LIFO (Last in first out).
5. Queue
A queue is an abstract data type in which insertion will take place in front and deletion
will take place in rear. It works in a principle of FIFO (First in first out).
6. List
A list is an ordered collection of elements.
7. Types of list
The types are
Singly linked list
Doubly linked list
Circular linked list
8. Heap
A heap is a specialized tree-based data structure that satisfies the heap property: If A is a
parent node of B then the key of node A is ordered with respect to the key of node B with the
same ordering applying across the heap.
9. Binary tree
A binary tree is a tree data structure in which each node has at most two child nodes
10. Binary search tree
A binary search tree (BST), sometimes also called an ordered or sorted binary tree, is a nodebased binary tree data structure which has the following properties:[1]
The left subtree of a node contains only nodes with keys less than the node's key.
The right subtree of a node contains only nodes with keys greater than the node's key.
The left and right subtree each must also be a binary search tree.
There must be no duplicate nodes.
11. Expression tree
An expression tree is a binary tree in which it consists of operands and operators. The leaf
node contains operands and interior nodes contain operators
12. Singly linked list
Singly linked list is a list in which it stores the contents of the node and a pointer or
reference to the next node in the list.
13. Doubly linked list
A doubly-linked list is a list data structure that consists of a set of sequentially
linked records called nodes. Each node contains two fields, called links, that are references to the
previous and to the next node in the sequence of nodes.
14. Circular linked list
A circular linked list is a linked list in which the head element's previous pointer points to
the tail element and the tail element's next pointer points to the head element. In the special case
of a circular list with only one element, the element's previous and next pointers point to itself,
and it is both the head and tail of the list.
15. Circular queue
Circular queues are particular implementations of queues. These queues are
made of an array that contains the items in the queue, an optional length and two array
indexes. The indexes are referred to as the tail and head pointers.
16. Tree
A tree is a collection of nodes. A node can be empty or it can have a distinguished node
called root or one or more non empty sub trees.
17. Almost complete binary tree
An almost complete binary tree is a tree in which each node that has a right child also has
a left child. Having a left child does not require a node to have a right child.
18. Complete binary tree
A complete binary tree is a binary tree in which every level, except possibly the last, is
completely filled, and all nodes are as far left as possible
19. Strictly binary tree
When every non-leaf node in binary tree is filled with left and right sub-trees, the tree is
called strictly binary tree.
20. AVL
An AVL tree (Adelson-Velskii and Landis' tree, named after the inventors) is a selfbalancing binary search tree, and it was the first such data structure.
21. Spanning Tree
A spanning tree is a tree associated with a network. All the nodes of the graph appear on
the tree once. A minimum spanning tree is a spanning tree organized so that the total edge weight
between nodes is minimized.
22. Priority queues
A priority queue is a collection of elements such that each element has been assigned a
priority.
23. Limitations of arrays?
i)Arrays are of fixed size.
ii)Data elements are stored in continuous memory locations which may not be available
always.
iii)Adding and removing of elements is problematic because of shifting the locations.
24. Overcoming the limitations of arrays
Limitations of arrays can be solved by using the linked list.
25. Linked list
Linked list is a data structure which store same kind of data elements but not in
continuous memory locations and size is not fixed. The linked lists are related logically.
26. Node
The data element of a linked list is called a node. Node consists of two fields: data field
to store the element and link field to store the address of the next node.
27. Divide and conquer
The basic idea is to divide the problem into several sub problems beyond which cannot
be further subdivided. Then solve the sub problems efficiently and join then together to get the
solution for the main problem.
28. Leaf
In a directed tree any node which has out degree o is called a terminal node or a leaf.
29. Tree traversal
Tree traversal (also known as tree search) refers to the process of visiting (examining
and/or updating) each node in a tree data structure, exactly once, in a systematic way.
30. Types of traversing
The different types of traversing are
i)Pre-order traversal-yields prefix from of expression.
ii)In-order traversal-yields infix form of expression.
iii)Post-order traversal-yields postfix from of expression.