0% found this document useful (0 votes)
28 views4 pages

Data Structures Lab Syllabus 2024-25

The document outlines the syllabus for the Data Structures Lab course for II Year B. Tech students starting from the 2024-25 academic year. It includes course outcomes, programming modules on searching, sorting, data structures like stacks, queues, linked lists, binary search trees, AVL trees, and graph traversal techniques, along with a case study component requiring practical applications. Students are expected to implement various algorithms and data structures using programming languages such as C, C++, Java, or Python.

Uploaded by

orr61115
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views4 pages

Data Structures Lab Syllabus 2024-25

The document outlines the syllabus for the Data Structures Lab course for II Year B. Tech students starting from the 2024-25 academic year. It includes course outcomes, programming modules on searching, sorting, data structures like stacks, queues, linked lists, binary search trees, AVL trees, and graph traversal techniques, along with a case study component requiring practical applications. Students are expected to implement various algorithms and data structures using programming languages such as C, C++, Java, or Python.

Uploaded by

orr61115
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

R24- Syllabus of ECE-GVPW(A) w.e.f.

2024-25

DATA STRUCTURES LAB


II Year B. Tech. I semester
[Common to CSE, CSE (AI&ML), IT, ECE]

L T P C
Course Code: 24CT11RC14 0 0 3 1.5

Course Outcomes: At the end of the Course, the student shall be able to
CO1: Apply different Searching and Sorting Techniques using arrays. (L3)
CO2: Experiment with different linear data structure concepts using stacks and Queues. (L3)
CO3: Develop linear data structure models using various Linked lists. (L3)
CO4: Build Binary Search Tree & AVL tree and examine their traversals. (L3)
CO5: Apply DFS and BFS graph traversal techniques. (L3)

Implement the following programs with either C/C++/JAVA/Python


Module-1: Searching
1. Write a program that use non recursive functions to perform linear search for a Key value in a given
list.
2. Write a program that use non recursive functions to perform Binary search for a Key value in a given
list.
Module-2: Sorting
1. Write a program that implement Bubble sort, to sort a given list of integers in ascending order.
2. Write a program that implement Selection sort, to sort a given list of integers in ascending order.
3. Write a program that implement Insertion sort, to sort a given list of integers in ascending order.
Module-3: Efficient Sorting
1. Write a program that implement Quick sort, to sort a given list of integers in ascending order.
Module-4: Stack & Queue
1. Write a program that implement stack (its operations) using arrays.
2. Write a program that implement Queue (its operations) using arrays.
Module-5: Singly Linked List
1. Write a program that uses functions to create and perform operations on singly linked list.
Module-6: Double Linked List
1. Write a program that uses functions to create and perform operations on double linked list.

Page 12 of 43
R24- Syllabus of ECE-GVPW(A) w.e.f.2024-25

Module-7: Circular Linked List


1. Write a program that uses functions to create and perform operations on circular linked list.

Module-8: Binary Search Trees


1. Write a program to Create a Binary Search Tree and Perform insertion and deletion operations.
Module 9: AVL tree
1. Write a program to Build an AVL tree and perform insertions.
Module-10: Graphs
1. Write a program to implement Depth First Search
2. Write a program to implement Breadth First Search

Case Study: Select any five practical applications mentioned below


Note: A report has to be submitted by every student at the end of the semester that includes requirements,
design, coding, and output with testing results of a real example.
1. Demonstrate to convert an infix expression into a postfix expression and evaluate to find the result.
2. Demonstrate to convert an infix expression into a prefix expression
3. Demonstrate a queue using Linked List and Stack.
4. Demonstrate a sparse matrix using array and linked list
5. Create a skip list, to insert these following keys in the empty skip list.
a. 6 with level 1.
b. 29 with level 1.
c. 22 with level 4.
d. 9 with level 3.
e. 17 with level 1.
f. 4 with level 2.
Implement all basic operations of skip list and demonstrate with examples. Skip list structure is shown
below for reference.

Page 13 of 43
R24- Syllabus of ECE-GVPW(A) w.e.f.2024-25

6. Given an array representation of min Heap, convert it to max Heap and then apply Heapsort concept
to display the data in decreasing order.
Input: arr[ ] = {3, 5, 9, 6, 8, 20, 10, 12, 18, 9}
7. Make use of Radix sort algorithm to sort an array by individual digits, starting with the least significant
digit.
8. Model a linked list data structure to add two polynomials.
9. Design a system to manage employee records {empID, empname, dept, salary}, and implement
efficient basic operations based on employee ID.
10. Construct an expression tree i.e. a binary tree in which each internal node corresponds to the operator
and each leaf node corresponds to the operand.
For example: expression tree for 3 + ((5+9)*2) would be: Demonstrate with required operations to
convert this above expression into corresponding prefix, and postfix expressions and evaluate the result
of the expression.

11. Demonstrate topological sorting for a Directed Acyclic Graph (DAG) is a linear ordering of vertices
such that for every directed edge u-v, vertex u comes before v in the increasing order a vertex with no.
of incoming edges.
12. Given a directed graph, check whether the graph contains a cycle or not. Your function should return
true if the given graph contains at least one cycle, else return false. For example, the following graph
contains two cycles 0->1->2->3->0 and 2->4->2. Demonstrate with required operations to display the
results in the form of true and the cyclic path if any. Make use of BFA concept to solve this problem.

Page 14 of 43
R24- Syllabus of ECE-GVPW(A) w.e.f.2024-25

13. Find the frequency of each character in a string using Hashing Data Structure

Page 15 of 43

Common questions

Powered by AI

Converting an infix expression (where operators are placed between operands) to a postfix expression (where operators follow their operands) involves the use of a stack data structure to temporarily hold operators and ensure proper precedence and associativity. The algorithm iterates over each token in the infix expression while differentiating between operand and operator precedence, using the stack to manage operators . Operators are pushed onto the stack until lower precedence operators or right parentheses are encountered, at which point the stack is popped to the output until the higher priority operator or left parenthesis is removed. Parentheses act as override tools to take control of precedence as this allows order differences seen naturally in expression evaluation, maintaining the sequence of operations that would be executed in an infix manner without evaluating them immediately . Care must be taken to process operators appropriately to avoid misordered expressions or priority mishandling.

Depth-first search (DFS) and breadth-first search (BFS) are fundamental graph traversal algorithms that differ primarily in their exploration strategy. DFS explores as far as possible along one branch before backtracking, favoring depth over breadth, and typically utilizes a stack structure, either explicitly or via recursion. It is well-suited for algorithms working to pathfind in mazes or puzzles where the depth from the start node is relevant . BFS, in contrast, explores all the nodes at the present depth level before proceeding to nodes at the next depth level, using a queue to track the traversal frontier. This strategy is optimal for finding the shortest path in unweighted graphs and is useful in level-order traversal of trees. BFS also assures the shortest path construct in any unweighted graph or tree, whereas DFS could potentially find suboptimal paths if constraints aren't applied .

Topological sorting is a linear ordering of vertices in a Directed Acyclic Graph (DAG) such that for every directed edge u-v, vertex u comes before v in the ordering. It is applicable only to DAGs because it assumes the absence of cycles, which guarantees a partial order where certain nodes precede others based on dependency . If applied to graphs with cycles, topological sorting would contradict the cycle's constraints as it would inherently demand an ordering violating the cycle's expectations. The significance of topological sorting lies in its application to scenarios like task scheduling, where tasks are interconnected by dependency constraints and need to be executed in a non-cyclic order to respect prerequisites. It is crucial in areas like compiling tasks, order of execution planning, and the resolution of dependencies in version control .

Skip lists offer several advantages over traditional linked lists, especially in scenarios where fast search and update times are important. By using multiple layers of linked lists and allowing multiple pointers for each node, skip lists provide a probabilistic alternative to balanced trees for maintaining order among elements . Their average complexity for search, insert, and delete operations is O(log n), similar to that of balanced trees, making them more efficient than singly linked lists which perform these operations in O(n) time. This efficiency is particularly beneficial in concurrent programming where mutable data structures can pose challenges. The layered structure allows certain operations to progress quickly while maintaining simplicity and ease of implementation compared to self-balanced trees .

A circular linked list is similar to a singly linked list but differs in that the last node points back to the first node rather than null, creating a loop-like structure . A doubly linked list, on the other hand, includes pointers in both directions, allowing traversal both forwards and backwards. This bidirectional access simplifies deletions and insertions as nodes have direct access to their predecessors . Circular lists are particularly advantageous in scenarios where iterations over the list are frequent or continuously rotating over elements is required, such as in round-robin scheduling in operating systems. This is because a circular list does not require resetting to the head after reaching the end. However, when operations involve backward traversals or frequent removals, doubly linked lists are preferred for their flexibility in navigation .

Binary search trees (BST) provide a simple way to implement dynamic sets and support basic operations such as insert, delete, and search. They are relatively easy to implement and understand. However, BSTs can become unbalanced, leading to O(n) performance time in the worst-case scenario . AVL trees, which are a type of self-balancing binary search tree, maintain a balance factor for each node, ensuring that the height of the tree remains approximately logarithmically proportional to the number of nodes (O(log n)), which improves the time complexity for operations. This balancing makes AVL trees preferable for situations where read operations are frequent and efficient access times are critical. The key disadvantage of AVL trees is the additional complexity and overhead for maintaining balance during insert and delete operations .

Quick sort stands out for its divide-and-conquer strategy, which recursively partitions the array around a pivot element, ensuring elements smaller than the pivot are on the left, and larger ones on the right. This partitioning divides the array into subarrays that are sorted independently. The efficiency derives from consistently reducing the problem size, leading to an average time complexity of O(n log n), though the worst-case scenario may reach O(n²) if poor pivot selections are made. Enhancements like randomized pivoting or median-of-three rule help counter these worst-cases . Quick sort is often preferred for in-place sorting due to its lower memory overhead compared to techniques like Merge sort, which requires additional storage. Its average logarithmic time efficiency and low overhead make it ideal for large datasets, granting significant advantages in scenarios where execution speed and memory usage are important, such as in system software development and general-purpose datasets sorting .

Hashing provides an efficient approach to determine the frequency of each character in a string by mapping characters to their frequency count using a hash table. For each character in the string, the hash table updates the count associated with that character, leveraging the constant-time complexity of hash lookups and insertions on average, resulting in an overall time complexity of O(n) concerning the string's length . The advantages of using hashing for this task include ease of implementation, high efficiency in both time and space, and the ability to handle large datasets rapidly. It provides immediate access to each character's frequency distribution, enabling quick statistical analyses or preprocessing tasks necessary for subsequent data processing steps, such as text compression or language parsing .

Linear search iterates through each element in the array sequentially until the key is found or the end of the array is reached, with a time complexity of O(n). It is simple to implement but inefficient for large datasets . Binary search requires the array to be sorted beforehand and follows a divide-and-conquer approach by repeatedly dividing the search interval in half. If the key is less than the middle element, the search continues in the left subarray; otherwise, it continues in the right subarray. Binary search offers better time complexity of O(log n), significantly improving performance on large datasets compared to linear search. However, the prerequisite of having a sorted array adds overhead .

Sparse matrices are best represented using data structures that allow efficient storage of only non-zero elements to save space. Using arrays for sparse matrices involves storing non-zero elements alongside their row and column indices, commonly known as the Compressed Sparse Row (CSR) format. This allows for efficient fixed-time access to elements but can be space-consuming relative to a linked list due to redundant storage and potential wasted space for dynamic scaling . Linked list representations, such as linked nodes containing row, column, and value information, enable dynamic allocation and deallocation of elements, which can be more space-efficient, particularly for very sparse matrices. The trade-off lies in the access time; linked lists typically require traversal of nodes to access specific elements, which is typically slower compared to arrays. Therefore, arrays may be preferred when the non-zero elements are spread regularly, while linked lists are more suitable for irregular sparse distributions .

You might also like