About Data Structure Using C & C++
Data Structures is one of the most important subjects in BCA. It teaches how to organise data so that programs can store, search and update it efficiently. Arrays, stacks, queues, linked lists and trees appear in almost every programming interview, and they are the basis of databases, operating systems and compilers.
What the units cover
- Arrays: one- and two-dimensional arrays, row-major and column-major storage and address calculation, and special matrices such as sparse and tridiagonal matrices.
- Stacks and queues: PUSH and POP operations, stack applications such as expression conversion, simple and circular queues, double-ended queues (deques) and priority queues.
- Lists: singly, doubly and circular linked lists, header nodes, insertion and deletion at any position, and overflow and underflow conditions.
- Trees: terminology, binary trees, tree traversals (preorder, inorder and postorder), binary search trees and heaps.
- B-Trees: multi-way search trees and why they are used for indexing large data on disk.
- Sorting techniques: bubble, selection, insertion, quick, merge and heap sort, and how they compare.
What the exam looks like
The Dec 2015 paper on this page (75 marks) asked short questions on sparse arrays, stack operations, headers in linked lists, indexing in binary search trees and how hashing improves performance. Medium questions covered tridiagonal matrices, deques versus priority queues, and the merge sort algorithm. The long questions included finding the address of an element in a 5 × 5 array stored in row-major and column-major order, writing PUSH and POP algorithms with an array implementation of a stack, inserting a node into a linked list at a given position, and building a heap from a list of ten values.
How to study it
Draw every operation. For a linked list insertion, sketch the nodes and pointers before and after; for a heap, draw the tree after each insertion. Then write the algorithm in clear steps. Examiners look for a correct algorithm and a dry run on an example as much as for code.
Topics worth practising
- Address calculation in row-major and column-major order
- Stack operations and infix to postfix conversion
- Linked list insertion and deletion
- Tree traversals and binary search tree operations
- Building a heap and heap sort
- Merge sort and quick sort
The notes and book notes on this page explain each structure; the previous year papers show how algorithms are asked.
