Free mock test
Programming Concepts and Data Structures

Programming Concepts and Data Structures

Databases and Programming · 3 min read

Algorithm, flowchart and pseudocode

  • An algorithm is a finite, ordered set of steps to solve a problem. It must be clear, finite and give a result.
  • Pseudocode is an algorithm written in plain, code-like English.
  • A flowchart draws the algorithm with symbols:
SymbolShapeMeaning
TerminalOvalStart and Stop
Input / OutputParallelogramRead or print data
ProcessRectangleCalculation or action
DecisionDiamondYes or No question
Flow lineArrowDirection of flow
ConnectorSmall circleJoins parts of a flowchart

Basic ideas

  • Variable: named memory location. Constant: value that does not change.
  • Data types: integer, float (decimal), character, string, boolean.
  • Control structures: sequence (one after another), selection (if, else, switch), iteration (loops: for, while, do-while).
  • Function (procedure): a named block of code that can be reused. Recursion: a function that calls itself. Array: an ordered collection of items of one type, accessed by an index (usually from 0).
  • IDE: Integrated Development Environment. Debugging: finding and fixing errors. API: a set of rules for programs to talk to each other.

Software Development Life Cycle (SDLC)

Requirements → Design → Coding → Testing → Deployment → Maintenance.

ModelIdea
WaterfallEach stage finishes before the next begins.
AgileShort cycles, constant feedback.
SpiralRepeated cycles with risk analysis.
PrototypeBuild a quick sample first.

Testing: unit (one part), integration (parts together), system, acceptance (by the customer). Black-box testing checks output without seeing code; white-box examines the code. Alpha test is inside the company; beta test is with real users outside.

Data structures

StructureRuleOperations
ArrayFixed size, indexed.Access by index
StackLIFO: Last In, First Out. Like a pile of plates.Push, Pop, Peek
QueueFIFO: First In, First Out. Like a ticket line.Enqueue, Dequeue
Linked listNodes joined by pointers. Easy insertion and deletion.
TreeHierarchy: root, parent, child, leaf. Binary tree: at most two children.Traversals: inorder, preorder, postorder
GraphVertices joined by edges.Used in maps and networks

Uses: a stack handles undo, function calls and bracket checking; a queue handles printer jobs and CPU scheduling.

Postfix example. Infix 2+3*4 written in postfix is 2 3 4 * +. Evaluate by pushing numbers on a stack: 3 × 4 = 12, then 2 + 12 = 14.

Searching and sorting

AlgorithmIdeaTime
Linear searchCheck items one by one.O(n)
Binary searchHalve a sorted list each step.O(log n)
Bubble sortSwap neighbouring items repeatedly.O(n²)
Selection sortPick the smallest each time.O(n²)
Insertion sortInsert each item in place.O(n²)
Merge sortDivide, sort, merge.O(n log n)
Quick sortPartition around a pivot.O(n log n) average, O(n²) worst

Big-O describes how the running time grows with the size n. Binary search needs sorted data; a list of 1,000 items needs at most 10 comparisons (2^10 = 1,024).

Keep practising

Notes are only half the work. Test yourself with questions and discuss doubts with other aspirants.

Prepared for exam revision from standard computer textbooks, Microsoft documentation and official sources. Features differ between Excel and Word versions (2016, 2019, 2021, 365) so check which version your exam follows. Found a mistake? Tell us.