KEMBAR78
DSA Questions | PDF
0% found this document useful (0 votes)
4 views2 pages

DSA Questions

The document outlines a series of programming questions focused on data structures, including arrays, linked lists, stacks, queues, and trees. Each section contains specific tasks such as finding maximum and minimum values, reversing data structures, detecting cycles, and performing various traversals. The questions are designed to test and enhance understanding of fundamental data structure operations and algorithms.

Uploaded by

alt.g9-1y8rgg9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

DSA Questions

The document outlines a series of programming questions focused on data structures, including arrays, linked lists, stacks, queues, and trees. Each section contains specific tasks such as finding maximum and minimum values, reversing data structures, detecting cycles, and performing various traversals. The questions are designed to test and enhance understanding of fundamental data structure operations and algorithms.

Uploaded by

alt.g9-1y8rgg9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 2

Programming Questions (Data Structures)

1. Arrays

a) Implement a function to find the maximum and minimum values in an


integer array.

b) Write a function to reverse an array in place.

c) Given an array of integers, find the two numbers such that their sum is
closest to a target value.

d) Implement a function to remove duplicates from a sorted array.

e) Given an array of integers, find the subarray with the maximum sum.

2. Linked Lists

a) Write a function to reverse a singly linked list.

b) Implement a function to detect a cycle in a linked list.

c) Given two sorted linked lists, merge them into a single sorted linked
list.

d) Implement a function to find the middle node of a linked list.

e) Given the heads of two singly linked lists, determine if they intersect. If
so, return the intersecting node.

3. Stacks

a) Implement a stack using an array.

b) Implement a stack using a linked list.

c) Evaluate a postfix expression using a stack.

d) Implement a function to check if parentheses in an expression are


balanced.

e) Design a data structure that supports push, pop, and min operations in
constant time.

4. Queues

a) Implement a queue using an array.

b) Implement a queue using a linked list.

c) Implement a function to reverse a queue.


d) Implement a breadth-first search (BFS) algorithm using a queue.

e) Design a queue that supports getting the minimum value in constant


time.

5. Trees

a) Implement a function to perform in-order traversal of a binary tree.

b) Implement a function to perform level-order traversal of a binary tree.

c) Implement a function to check if a given binary tree is a binary search


tree.

d) Implement a function to find the lowest common ancestor of two nodes


in a binary tree.

e) Implement a function to find the maximum depth of a binary tree.

You might also like