student notes / est. for the classroom

HTML, CSS, JavaScript, Python, data science, computer networks — written the way you'd explain it to a classmate, not a compiler.

Top Job & Internship Portals

Handpicked portals for fresher jobs, tech roles, and listings in Hyderabad

GFG

GeeksforGeeks

Tech & Software Roles

Visit →
INT

Internshala

Fresher Jobs & Internships

Visit →
GOOG

Google Careers

Global Google Openings

Visit →
APN

Apna Jobs

Local Jobs in Hyderabad

Visit →
INS

Instahyre

Tech Roles in Hyderabad

Visit →
NAUK

Naukri.com

Fresher Jobs in Hyderabad

Visit →
📢 Updated daily

Internship & Job Alerts

01

Latest notes

July 28, 2025

GATE questions

 DS Data Structures

Q1. Consider the following array of integers:

A = [2, 3, 7, 10, 12, 15, 18]
What is the time complexity of the best algorithm to determine whether there exists a pair of elements whose sum is 22?

A. O(n²)
B. O(n log n)
C. O(n)
D. O(log n)

✅ Answer: C
Use two-pointer technique since array is sorted → O(n)


✅ C++ Code:


#include <iostream> using namespace std; bool hasPairWithSum(int arr[], int n, int target) { int i = 0; // Start pointer int j = n - 1; // End pointer while (i < j) { int sum = arr[i] + arr[j]; if (sum == target) { cout << "Pair found: " << arr[i] << " + " << arr[j] << " = " << target << endl; return true; } else if (sum < target) { i++; // Move to higher value } else { j--; // Move to lower value } } cout << "No pair found with sum " << target << endl; return false; } int main() { int A[] = {2, 3, 7, 10, 12, 15, 18}; int n = sizeof(A) / sizeof(A[0]); int target = 22; hasPairWithSum(A, n, target); return 0; }

🧪 Output:

Pair found: 7 + 15 = 22

🕒 Time Complexity:

  • O(n) — each element is visited at most once.

  • Space Complexity: O(1)

 


📚 2. Stacks

Q2. What is the output of the following postfix expression?

Postfix: 6 2 3 + - 3 8 2 / + *

A. 15
B. 24
C. 18
D. 36

✅ Answer: B
Expression: 6 - (2 + 3) = 1, and 3 + (8 / 2) = 7 → 1 * 7 = 7

Wait! Let's redo that properly:


Step-by-step: 6 2 3 + → 6 5 → 6 - 5 = 1 3 8 2 / → 3 4 → 3 + 4 = 7 1 * 7 = 7

Oops! There’s an error in the key.

✅ Correct Answer: 7

✅ Tree Traversal Dry Run – Sample

Given Tree:


A / \ B C / \ \ D E F

Traversals:

  • Inorder: D B E A C F

  • Preorder: A B D E C F

  • Postorder: D E B F C A

  • Level Order (BFS): A B C D E F



















2 comments:

  1. Estate Paramount presenting the The Sky Heights - Enquiry Form, your entryway to upscale Panchkula living, is Estate Paramount. Enter your information to view opulent homes, cutting-edge features, and investment options intended for a sophisticated way of life. Start your path to better life right now. For more visit us!

    ReplyDelete
  2. I enjoyed reading your content. Keep doing your best work.
    Hire Python Developer in Chennai

    ReplyDelete

02

Capstone resource hub

Codingacharya

Capstone Learning Resources, Notes & Project Hub

TCS NQT Questions
Read Notes
Machine Learning – ACE Theory
Read Notes
Machine Learning PPT
Read Notes
MachienLearning LAB
Read Notes
CSPT LAB programs
Read Notes
Time table and CSPT syllabus
Read Notes
Appreciations
Read Notes
ISTE life memberships
Read Notes
Artificial Intelligence & Analytics
Read Notes
Fullstack Web Dev
Read Notes
MERN Web Dev
Read Notes
Course Structure
Read Notes
Cloud Computing
Read Notes
90 Days ML Challenge
Read Notes
Advanced Analytics & Viz
Read Notes
Advanced Machine Learning
Read Notes
React JS
Read Notes
ML Chaitanya
Read Notes
Important Links
Read Notes
CSS Effects
Read Notes
RESUME
Read Notes
Bootstrap CSS
Read Notes
MongoDB
Read Notes
OWN Python Package
Read Notes
HTML Course
Read Notes
HTML Projects
Read Notes
GitHub Projects
Read Notes
Angular JS
Read Notes
Journals
Read Notes
NLP Notes
Read Notes
Videos
Read Notes
Data Analytics & Viz
Read Notes
Cloud Computing (Archive)
Read Notes
Open CV
Read Notes
jQuery
Read Notes
React JS (Archive)
Read Notes
Node JS
Read Notes
DAV Theory
Read Notes
DAV Lab
Read Notes
Big Data Notes
Read Notes
R-Programming
Read Notes
HADOOP Lab
Read Notes
GATE DA
Read Notes
JAVA Lab
Read Notes
Computer Networks
Read Notes
03

Live projects & profiles