This document contains a data structures question paper from Anna University. It has two parts:
Part A contains 10 short answer questions covering topics like ADT, linked stacks, graph theory, algorithm analysis, binary search trees, and more.
Part B contains 5 long answer questions each worth 16 marks. Topics include algorithms for binary search, linear search, recursion, sorting, trees, graphs, files, and more. Students are required to write algorithms, analyze time complexity, and provide examples for each question.
Part B CS8391 Data Structures Part B Questions compiled from R2008 & R2013 to help the students of Affiliated Colleges appearing for Ann University Examination
Part B CS8391 Data Structures Part B Questions compiled from R2008 & R2013 to help the students of Affiliated Colleges appearing for Ann University Examination
Design & Analysis of Algorithms Lecture NotesFellowBuddy.com
FellowBuddy.com is an innovative platform that brings students together to share notes, exam papers, study guides, project reports and presentation for upcoming exams.
We connect Students who have an understanding of course material with Students who need help.
Benefits:-
# Students can catch up on notes they missed because of an absence.
# Underachievers can find peer developed notes that break down lecture and study material in a way that they can understand
# Students can earn better grades, save time and study effectively
Our Vision & Mission – Simplifying Students Life
Our Belief – “The great breakthrough in your life comes when you realize it, that you can learn anything you need to learn; to accomplish any goal that you have set for yourself. This means there are no limits on what you can be, have or do.”
Like Us - https://www.facebook.com/FellowBuddycom
UML stands for Unified Modelling Language.
UML is a standard language for specifying, visualizing, constructing, and documenting a system in which software represents the most significant part.
UML is different from the other common programming languages like C++, Java, COBOL etc.
UML is a pictorial language used to make software blue prints.
UML can serve as a central notation for software development process. Using UML helps project teams communicate, explore potential designs, and validate the architectural designs of software.
UML diagrams are made using notation of things and relationships.
The building blocks of UML can be defined as:
Things
Relationships
Diagrams
Things: Things are the most important building blocks of UML. Things can be:
Structural
Behavioral
Grouping
Annotational
The Structural things define the static part of the model. They represent physical and conceptual elements. Following are the brief descriptions of the structural things.
Class: Class represents set of objects having similar responsibilities.
Interface: Interface defines a set of operations which specify the responsibility of a class.
Collaboration: Collaboration defines interaction between elements.
Use case: Use case represents a set of actions performed by a system for a specific goal.
Component: Component describes physical part of a system.
Node: A node can be defined as a physical element that exists at run time.
A behavioral thing consists of the dynamic parts of UML models. Following are the behavioral things:
Interaction: Interaction is defined as a behavior that consists of a group of messages exchanged among elements to accomplish a specific task.
State machine: State machine is useful when the state of an object in its life cycle is important. It defines the sequence of states an object goes through in response to events. Events are external factors responsible for state change.
Content of slide
Tree
Binary tree Implementation
Binary Search Tree
BST Operations
Traversal
Insertion
Deletion
Types of BST
Complexity in BST
Applications of BST
Control Strategies
Control Strategy in Artificial Intelligence
scenario is a technique or strategy, tells us about which rule has to be applied next while searching for the solution of a problem within problem space.
It helps us to decide which rule has to apply next without getting stuck at any point.
Characteristics of Control Strategies
A good Control strategy has two main
characteristics:
Control Strategy should cause Motion
Control strategy should be Systematic
Co ntrol Strategy should cause Motion
Each rule or strategy applied should cause the motion because if there will be no motion than such control strategy will never lead to a solution. Motion states about the change of state and if a state will not change then there be no movement from an initial state and we would never solve the problem.
Co ntrol Strategy should be Systematic
Though the strategy applied should create the
motion but if do not follow some systematic
strategy than we are likely to reach the same state
number of times before reaching the solution
which increases the number of steps. Taking care of only first strategy we may go through particular useless sequences of operators several times. Control Strategy should be systematic implies a need for global motion as well as for local motion.
Design & Analysis of Algorithms Lecture NotesFellowBuddy.com
FellowBuddy.com is an innovative platform that brings students together to share notes, exam papers, study guides, project reports and presentation for upcoming exams.
We connect Students who have an understanding of course material with Students who need help.
Benefits:-
# Students can catch up on notes they missed because of an absence.
# Underachievers can find peer developed notes that break down lecture and study material in a way that they can understand
# Students can earn better grades, save time and study effectively
Our Vision & Mission – Simplifying Students Life
Our Belief – “The great breakthrough in your life comes when you realize it, that you can learn anything you need to learn; to accomplish any goal that you have set for yourself. This means there are no limits on what you can be, have or do.”
Like Us - https://www.facebook.com/FellowBuddycom
UML stands for Unified Modelling Language.
UML is a standard language for specifying, visualizing, constructing, and documenting a system in which software represents the most significant part.
UML is different from the other common programming languages like C++, Java, COBOL etc.
UML is a pictorial language used to make software blue prints.
UML can serve as a central notation for software development process. Using UML helps project teams communicate, explore potential designs, and validate the architectural designs of software.
UML diagrams are made using notation of things and relationships.
The building blocks of UML can be defined as:
Things
Relationships
Diagrams
Things: Things are the most important building blocks of UML. Things can be:
Structural
Behavioral
Grouping
Annotational
The Structural things define the static part of the model. They represent physical and conceptual elements. Following are the brief descriptions of the structural things.
Class: Class represents set of objects having similar responsibilities.
Interface: Interface defines a set of operations which specify the responsibility of a class.
Collaboration: Collaboration defines interaction between elements.
Use case: Use case represents a set of actions performed by a system for a specific goal.
Component: Component describes physical part of a system.
Node: A node can be defined as a physical element that exists at run time.
A behavioral thing consists of the dynamic parts of UML models. Following are the behavioral things:
Interaction: Interaction is defined as a behavior that consists of a group of messages exchanged among elements to accomplish a specific task.
State machine: State machine is useful when the state of an object in its life cycle is important. It defines the sequence of states an object goes through in response to events. Events are external factors responsible for state change.
Content of slide
Tree
Binary tree Implementation
Binary Search Tree
BST Operations
Traversal
Insertion
Deletion
Types of BST
Complexity in BST
Applications of BST
Control Strategies
Control Strategy in Artificial Intelligence
scenario is a technique or strategy, tells us about which rule has to be applied next while searching for the solution of a problem within problem space.
It helps us to decide which rule has to apply next without getting stuck at any point.
Characteristics of Control Strategies
A good Control strategy has two main
characteristics:
Control Strategy should cause Motion
Control strategy should be Systematic
Co ntrol Strategy should cause Motion
Each rule or strategy applied should cause the motion because if there will be no motion than such control strategy will never lead to a solution. Motion states about the change of state and if a state will not change then there be no movement from an initial state and we would never solve the problem.
Co ntrol Strategy should be Systematic
Though the strategy applied should create the
motion but if do not follow some systematic
strategy than we are likely to reach the same state
number of times before reaching the solution
which increases the number of steps. Taking care of only first strategy we may go through particular useless sequences of operators several times. Control Strategy should be systematic implies a need for global motion as well as for local motion.
Ec2203 digital electronics questions anna university by www.annaunivedu.organnaunivedu
EC2203 Digital Electronics Anna University Important Questions for 3rd Semester ECE , EC2203 Digital Electronics Important Questions, 3rd Sem Question papers,
http://www.annaunivedu.org/digital-electronics-ec-2203-previous-year-question-paper-for-3rd-sem-ece-anna-univ-question/
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Communications Mining Series - Zero to Hero - Session 1DianaGray10
This session provides introduction to UiPath Communication Mining, importance and platform overview. You will acquire a good understand of the phases in Communication Mining as we go over the platform with you. Topics covered:
• Communication Mining Overview
• Why is it important?
• How can it help today’s business and the benefits
• Phases in Communication Mining
• Demo on Platform overview
• Q/A
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...SOFTTECHHUB
The choice of an operating system plays a pivotal role in shaping our computing experience. For decades, Microsoft's Windows has dominated the market, offering a familiar and widely adopted platform for personal and professional use. However, as technological advancements continue to push the boundaries of innovation, alternative operating systems have emerged, challenging the status quo and offering users a fresh perspective on computing.
One such alternative that has garnered significant attention and acclaim is Nitrux Linux 3.5.0, a sleek, powerful, and user-friendly Linux distribution that promises to redefine the way we interact with our devices. With its focus on performance, security, and customization, Nitrux Linux presents a compelling case for those seeking to break free from the constraints of proprietary software and embrace the freedom and flexibility of open-source computing.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!SOFTTECHHUB
As the digital landscape continually evolves, operating systems play a critical role in shaping user experiences and productivity. The launch of Nitrux Linux 3.5.0 marks a significant milestone, offering a robust alternative to traditional systems such as Windows 11. This article delves into the essence of Nitrux Linux 3.5.0, exploring its unique features, advantages, and how it stands as a compelling choice for both casual users and tech enthusiasts.
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Data structures question paper anna university
1. data structures question paper anna university.
CS 1151 DATASTRUCTURES
PART – A (10 * 2 = 20 Marks)/
Answer ALL questions
1. Define ADT.
2. How do you push and pop elements in a linked stack?
3. Prove that the number of odd degree vertices in a connected graph should be even.
4. Define NP hard and NP complete.
5. Define binary search tree.
6. List out and define the performance measures of an algorithm.
7. What is Recursion? Explain with an example.
8. List out the various techniques of hashing.
9. What is the worst case complexity of Quick sort?
10. State the algorithmic technique used in merge sort.
PART B (5 * 16 = 80 Marks)
11.(a) Derive the best, average, worst case time complexity of a linear search.
(b) (i) Develop an algorithm for binary search. Validate the algorithm with a suitable data set.
(10)
(ii) What is Top down approach? Explain. (6)
12. (a) Write ADT operations for array implementation of polynomial addition. (b) Write
ADT operations for array implementation of a queue.
13. (a) Write insertion algorithm for AVL tree. Write suitable rotation algorithms. (b) (i)
Explain the algorithm for separate chaining. ( 8 )
(ii) Explain implementation of priority queue ( 8 )
14. (a) Write ADT operations for heap sort. Using the above algorithm sort the following:
35 45 25 11 6 85 17 35
(b) (i) Explain the quick sort algorithm. ( 8 )
(ii) Explain external sorting. Give relevant example. ( 8 )15. (a) Explain Dijkstra’s
algorithm using the following graph. Find the shortest path between v1, v2, v3, v4, v6 and
v7.
[Diagram not available] (b) (i) Write ADT operation for Prim’s algorithm. ( 8 )
(ii) Explain the topological sort algorithm. ( 8 )
1. What do you mean by sorting? Mention the di erent types of sorting, give some
examples and explain any one indetail. [16 marks]
2. Compare the advantage and disadvantage of bubble, insertion and selection sort.
3. Write a program to sort the elements whose worst and average case are O(n log n).
[16 marks]
2. 4. Write a program to explain selection sort . Which type of technique does it belong.
[16 marks]
5. Write a program to explain selection sort . Which type of technique does it belong.
[16 marks]
6. Write a program to sort the elements whose worst case is O(n2) and average case is
O(n log n). [16 marks]
7. (a) Explain selection sort indetail.
(b) Explain bubble sort indetail. [8+8]
8. Write an algorithm for routine merge(x,lb1,ub1,ub2) that assumes that x[lb1]
through x[ub1] and x[ub1 + 1] through x[ub2] are sorted and merges the two into
x[lb1] through x[ub2]. [16 marks]
9. (a) Explain Quick sort with algorithm.
(b) Analyse the worst case performance of Quick sort and compare with Selection
sort.[8+8 marks]
10. (a) Write a C program to sort the elements of an array using Quick sort with
suitable example.
(b) What is the worst case and best case time complexity of the above program?
11. Write an algorithm for quick sort. What is its time complexity. [16 marks]
12. (a) Write an algorithm for selection sort
(b) Sort the following numbers using selection sort and give the required steps.
96,31,27,42,34,76,61,10,4 [8+8]
13. (a) Using linear search delete the number 26 from the list of numbers and give the
steps.
10,7,17,26,32,92
(b) Write a C program to implement the same. [8+8 marks]
14. (a) Distinguish between linear and binary search methods.
(b) Write an algorithm for non-recursive binary search method. [8+8 marks]
15. (a) Write a C program to sort the elements of an array using bubble sort technique
with a suitable example.
(b) What is the worst case and best case time complexity of bubble sort? [10+6
marks]
16. (a) Write a C program to sort given integers using partition exchange sort.
(b) Derive the time complexity of partition exchange sort. [8+8]
17. Write a C program that searches a value in a stored array using binary search.
What is the time complexity of binary search? [16 marks]
18. (a) Write a C program to merge two sorted arrays of integers.
(b) Derive the time complexity of merge sort. [8+8 marks]
19. (a) Write and explain non-recursive algorithm for binary search with suitable
example and discuss the various time complexities of binary search.
(b) Suppose that the list contains the integers 1,2,8 in this order. Trace through the
steps of binary search to determine what comparisons of keys are done in searching.
i. To lo cate 3
ii. To lo cate 4.5 [8+8 marks]
20. Trace through the steps by hand to sort the following list in Quick sort.
28 7 39 3 63 13 61 17 50 21 [16 marks]
21. What are the advantages and disadvantages of stack ? Write a program to illustrate
stack operation ? [16 marks]
22. Give an algorithm / C program to reverse a singly linked circular list inplace. [16
marks]
23. What are the advantages and disadvantages of stack ? Write a program to illustrate
queue operation ? [16 marks]
3. 24. Compare singly and doubly linked list to perform insertion operation . [16 marks]
25. Write a program to illustrate the various operations of singly linked list . [16 marks]
26. Write a program to delete a node in singly and doubly linked list . [16 marks]
27. Write a C program using pointers to implement Queue with all operation. [16
marks]
28. Write a routine to concatenate two singly linked lists. [16 marks]
29. What is a stack? Explain two di erent representations of a stack. List the operations
performed on a stack and write functions for implementing these operations.[16
marks]
30. (a) Write a 'C' Program to convert an infix expression into prefix expression (b)
Transform the following expression to prefix, using the approach (A + B) * (C$(D -
E) + F) - G [8+8 marks]
31. (a) Mention and explain various types of queues and give an example for each (b)
Compare various types of queues. [8+8 marks]
32. Write an algorithm to perform each of the following operations to a linked list. (a)
Return the sum of the integers in a list. (b) Return the number of elements in a list.
[8+8 marks]
33. Design insertion and deletion algorithms for a doubly linked circular lists. [16
marks]
34. (a) Derive a method to convert a postfix expression into its prefix form (b) Consider
the following arithmetic expression in postfix notation: 7 5 2 + * 4 1 5 - / - i. Find the
equivalent prefix form of the above . ii. Obtain the computed value of the expression
from its postfix notation.[8+4+4 marks]
35. (a) What is a network? (b) What is a spanning tree? (c) Define minimal spanning
tree . (d) What are the various traversals in a tree? [16 marks]
36. Write an algorithm to perform deletion operation in a Binary Search Tree. [16
marks]
37. (a) Define multi graph and graph with self- loop . (b) Explain connected graph with
example. [8+8 marks]
38. Explain Kruskal's method of determining the minimal spanning tree. [16 marks]
39. (a) Write a program to swap nodes in a binary tree. (b) Write a program to find min
and max nodes in a binary tree. [8+8 marks]
40. Explain binary search tree operations indetail. [16 marks]
41. Explain non-recursive and recursive algorithm for converse in order traversal of
binary tree. [16 marks]
42. Write a C program for creating, inserting and deletion in a Binary tree. [16 marks]
43. (a) Describe di erent types of trees. (b) Write a C program to implement Binary
tree. [6+10 marks]
44. (a) List and explain about the basic operations on a graph. (b) Write a C program
for depth first search of a graph. [7+9 marks]
45. Write a C program for creating, inserting and deletion in a Binary tree. [16 marks]
46. (a) Write C function for minimum spanning tree of a weighted undirected graph (b)
Write a C program to implement depth first traversal of graph. [10+6 marks]
47. (a) List and explain about the basic operations on a graph. (b) Write a C program
for depth first search of a graph. [7+9 marks]
48. Write and explain the breath first traversal and depth first traversal in a graph with
algorithm. [8+8 marks]
49. Write in detail about the following: (a) Depth first search of a graph (b) Minimum
spanning trees [8+8 marks]
50. (a) Define graph. Explain the properties of a graph. (b) What is the di erence
between strongly connected graph and weakly connected graph? [8+8 marks]
4. Time : Three hours Maximum : 100 marks
Answer ALL questions.
PART A — (10 ? 2 = 20 marks)
1. Define data structure and storage structure.
2. What is iteration? Give example.
3. What are primitive data types?
4. Compare the following statement : Break and Continue.
5. Differentiate singly linked list and circularly linked list.
6. Define stack.
7. What is hashing function?
8. Define single rotation on AVL tree.
9. Define direct access in a file.
10. What is the difference between binary tree and binary search tree?
PART B — (5 ? 16 = 80 marks)
11. (i) Write an algorithm for binary searching with example. Analyze the time
requirement of the algorithm. (11)
(ii) Explain the structure of indexed sequential files. (5)
12. (a) (i) Explain in detail about top–down approach and bottom–up approach with
suitable programming examples. (10)
(ii) Discuss about sequence selection iteration with examples. (6) Or
(b) (i) What is recursion? Give the application of recursion with programs.
(10)
(ii) What are the features of structured programming methodologies? Explain. (6)
13. (a) (i) What are the I/O statements used in ‘C’? Explain with examples. (8)
(ii) Write a program to compute the sum of the digits in a number and also to
reverse the digits. (8) Or
(b) (i) Discuss various control functions used in C. (8)
(ii) Solve the following equations for and using C language : (8)
14. (a) (i) What are the various stack operations? Explain. (6)
(ii) What are the various queue operations? Explain. (5)
(iii) Explain the application of stack for conversion of infix to postfix. (5) Or
(b) (i) What are the advantages and disadvantages of doubly linked list over singly
linked list? Explain the application of doubly linked list.
(9) (ii) Implement any two operations on circular linked list. (7)
15. (a) (i) Give a binary tree representation of the expression . (3)
(ii) What are the various tree traversal methods? Explain. (9)
(iii) Write an algorithm to convert general tree to binary tree. (4) Or
(b) (i) List out the application of binary tree and explain. (6)
(ii) Describe various hashing techniques. (10)
5. PART A-(10 X 2=20 marks)
1.When will you say an algorithm efficient? Give the notations for time complexity.
2.What is a ‘top-down’ design? Is ‘C’ language a top down design? Justify your
answer.
3.Why is linked list used for polynomial arithmetic?
4.Write the role of stack in function call.
5.What is the minimum number of nodes in an AVL tree of height 5?
6.What is the use of sentinel value in binary heap?
7.Which is the best way of choosing the pivot element in quick sort?
8.Merge sort is better than insertion sort. Why?
9.Define a graph. How it differs from tree?
10.What is minimum spanning tree? Name any two algorithms used to find MST.
PART B-(5 X 16=80 marks)
11.(a).(i).Given two lists L1 and L2, write the routines to compute L1 n L2 using
basic operations.
(ii).Write the routines for inserting and deleting elements from a queue. Check for
the conditions Q-empty and Q-full.
11.(b).(i).How would you implement a stack of queues? Write routines for creation
and inserting of elements into it.
(ii).Write routines to insert heterogeneous data into the list.
12.(a).(i).Write the routines to insert and remove a node from Binary Search Tree.
(ii).A full node is a node with two children. Prove that the number of full nodes plus
one is equal to the number of leaves in a binary tree.
12.(b).(i).Show the resulting of inserting 2,1,4,5,9,3,6,7 into an empty AVL tree.
(ii).Write the procedure to implement single and double rotations while inserting
nodes in an AVL tree.
13.(a).Explain with suitable examples the basic heap operations and algorithms for
the same.
13.(b).How will you resolve the collisions, while inserting elements into the hash
table using separate chaining and linear probing? Write the routines for inserting,
searching and removing elements from the hash table using the above mentioned
techniques.
14.(a).(i).Write the routine for sorting n elements in increasing order using heap
sort.
(ii).Sort 3,1,4,1,5,9,2,6 in decreasing order using heap sort.
14.(b).(i).Explain with example about the insertion sort.
(ii).What is external sorting? Discuss the algorithms with proper examples.
15.(a).(i).Discuss and write the program to perform topological sorting.
(ii).What is single source shortest path problem? Discuss Dijikstra’s single source
shortest path algorithm with an example.
15.(b).(i).Write an algorithm to find the minimum cost spanning tree of an
undirected, weighted graph.
(ii).Find the MST for the following graph.
6. Data Strucutre Questions
1. What is data structure?
A data structure is a way of organizing data that considers not only
the items stored, but also their relationship to each other. Advance
knowledge about the relationship between data items allows designing of
efficient algorithms for the manipulation of data.
2. List out the areas in which data structures are applied extensively?
• Compiler Design,
• Operating System,
• Database Management System,
• Statistical analysis package,
• Numerical Analysis,
• Graphics,
• Artificial Intelligence,
• Simulation
3. What are the major data structures used in the following areas : RDBMS,
Network data model & Hierarchical data model.
• RDBMS – Array (i.e. Array of structures)
• Network data model – Graph
• Hierarchical data model – Trees
4. If you are using C language to implement the heterogeneous linked list,
what pointer type will you use?
The heterogeneous linked list contains different data types in its
nodes and we need a link, pointer to connect them. It is not possible to use
ordinary pointers for this. So we go for void pointer. Void pointer is
capable of storing pointer to any type as it is a generic pointer type.
5. Minimum number of queues needed to implement the priority queue?
Two. One queue is used for actual storing of data and another for
storing priorities.
7. CS 1151-DATA STRUCTURES
Answer all the questions:
PART A-(10 X 2=20 marks)
1.When will you say an algorithm efficient? Give the notations for time complexity.
2.What is a ‘top-down’ design? Is ‘C’ language a top down design? Justify your
answer.
3.Why is linked list used for polynomial arithmetic?
4.Write the role of stack in function call.
5.What is the minimum number of nodes in an AVL tree of height 5?
6.What is the use of sentinel value in binary heap?
7.Which is the best way of choosing the pivot element in quick sort?
8.Merge sort is better than insertion sort. Why?
9.Define a graph. How it differs from tree?
10.What is minimum spanning tree? Name any two algorithms used to find MST.
PART B-(5 X 16=80 marks)
11.(a).(i).Given two lists L1 and L2, write the routines to compute L1 n L2 using
basic operations.
(ii).Write the routines for inserting and deleting elements from a queue. Check for
the conditions Q-empty and Q-full.(Or)
11.(b).(i).How would you implement a stack of queues? Write routines for creation
and inserting of elements into it.
(ii).Write routines to insert heterogeneous data into the list.
12.(a).(i).Write the routines to insert and remove a node from Binary Search Tree.
(ii).A full node is a node with two children. Prove that the number of full nodes plus
one is equal to the number of leaves in a binary tree.(Or)
12.(b).(i).Show the resulting of inserting 2,1,4,5,9,3,6,7 into an empty AVL tree.
(ii).Write the procedure to implement single and double rotations while inserting
nodes in an AVL tree.
13.(a).Explain with suitable examples the basic heap operations and algorithms for
the same.(Or)
13.(b).How will you resolve the collisions, while inserting elements into the hash
table using separate chaining and linear probing? Write the routines for inserting,
searching and removing elements from the hash table using the above mentioned
techniques.
14.(a).(i).Write the routine for sorting n elements in increasing order using heap
sort.
(ii).Sort 3,1,4,1,5,9,2,6 in decreasing order using heap sort.(Or)
14.(b).(i).Explain with example about the insertion sort.
(ii).What is external sorting? Discuss the algorithms with proper examples.
15.(a).(i).Discuss and write the program to perform topological sorting.
(ii).What is single source shortest path problem? Discuss Dijikstra’s single source
shortest path algorithm with an example.(Or)
8. 15.(b).(i).Write an algorithm to find the minimum cost spanning tree of an
undirected, weighted graph.
(ii).Find the MST for the following graph.
1. (a) Write an algorithm for stack operations. (10)
(b) Explain applications of trees with suitable examples. (10)
2. (a) Explain Heap sort with suitable example. (10)
(b) Write the algorithm for quick sort and explain with an example. (10)
3. (a) Explain the Greedy Algorithms. (10)
(b) Write the Kruskal algorithm for a minimum spanning tree. (10)
4. (a) What is linear search, binary search ? Write algorithms for both and comment
on the complexity. (15)
(b) Write short notes on graph coloring. (5)
5. (a) Explain Strassen's matrix multiplication. (10)
(b) Explain the travelling salesperson problem. (10)
6. (a) Explain Branch and Bound algorithm. (10)
(b) Discuss code optimization techniques. (10)
7. (a) Discuss in detail on hashing with examples. (10)
(b) Write an algorithm that will perform an insertion and deletion of a node in a
singly linked list. (10)
8. (a) Describe Np - Hard scheduling problems. (10)
(b) Describe Np - Hard code generation. (10)
MODEL QUESTION PAPER
B.E / B.Tech. Degree Examinations III Semester
IF 246 DATA STRUCTURES AND ALGORITHMS
PART – A
(10 x 2 = 20 Marks)
1. Take a linear search algorithms and discuss best-case time analysis.
2. Explain the basic of the Markov algorithm and discuss two ways in which such an
algorithm terminates.
3. What is the purpose of a stack in implementing a recursive procedure? Explain.
4. What is the need for using circular array to implement queues?
5. Give the tree T, find the inorder and postorder traversals.
6. Discuss the basis of the Buddy system of allocation. What type of fragmentation
still exists?
7. Discuss the timing analysis of the heap-sort algorithm.
8. What are the two broad classes of collision resolution techniques? Explain.
9. With an example explain the Huffman encoding scheme.
10. Explain how the size of a hashing table could be decreased when using (a) linear
hashing, (b) dynamic hashing.
9. PART – B
(5 x 16 = 80 Marks)
11. i) Implement typical stack operation when stacks are represented using (1) arrays
and (ii) using singly linked lists. (8 Marks)
ii) Define a binary tree. (2 Marks)
iii) Give the iterative algorithm for the inorder traversal of a binary tree. (6 Marks)
12a. i) Design a string manipulation algorithm for duplicating a given character string N
times. (6 Marks)
ii) Design an algorithm which trims off all the trailing blanks of a character string.
(5 Marks)
iii) Give a procedure that uses a stack in order to reverse the elements of a circular
queue which is stored in an array. (5 Marks)(OR)
12b. i) Given as input a word form assigned to the variable WORD, derive function
ORD-SEARCH which searches the ordered array of words looking for the word
form. If the word form is present, its index location is returned, else zero is
returned. Any search procedure can be used. (6 Marks)
ii) Assume we have a priority queue split into several queues.
To access these queues we have vectors of pointers to the front and rear of each
queue and one to indicate the length of each.
Thus to access the front of the queue representing priority 2, one merely starts at
PRIORITY_F[2]. This representation allows each queue to be of different length.
Given this representation, devise algorithms to insert and delete from a priority
queue. (10 Marks)
13a. i) Give an algorithm to reverse the elements of a single linked lists without using a
temporary list. (6 Marks)
ii) Write algorithms to insert into and delete elements from a doubly linked list.
(6 Marks)
iii) Write an algorithms to count the number of nodes in a given singly linked list.
(4 Marks)(OR)
13b. i) Write algorithms to allocate and free nodes in a body system of memory
allocation. (10 Marks)
ii) Write an algorithm to add two polynomials when the polynomials are represented
using singly linked lists. (6 Marks)
14a. i) Give the best case and worst case analysis of the binary search. (8 Marks)
ii) Write any one external sorting algorithm in detail. (8 Marks(OR)
14b. i) Write an algorithm to delete a node from a binary search tree. (8 Marks)
ii) Give the radix sort algorithm in detail. (8 Marks)
15a. i) Give in detail the structure of a typical Indexed Sequential file. (8 Marks)
ii) Describe the direct file organization and give the procedure to retrieve a record
from a direct file given the key. (8 Marks)(OR)
15b. Write notes on:-
i. Garbage compaction (6 Marks)
ii. VASM Files (5 Marks)
iii. Virtual Hashing (5 Marks)
10. Subject: Data Structures Sub Code: CS 35
Part- I
1. With examples, explain different storage classes used in C.
2. Write a note on enumeration data type.
3. Write the prefix & postfix form of the following .
1. (( A + B ) * C – ( D – E ) $ ( F+a)
2. (A + B) * (C + D -E) * F
4. Show that the detailed contents of the stack for given postfix examples. 623 + -
382 / + * 2 $ 3 +
5. Write a note on Preprocessor directives.
6. Why MACROS are needed. Explain with examples.
7. Differentiate between Structure & Unions members.
8. What is the significance of dynamic memory allocation.Explain C function that
support Dynamic allocation.
10. Write the dynamic representation of stack? For such a representations. Write the
Push & Pop routines.
11. Write the algorithm to find the maximum & minimum values singly linked list.
12. Write the algorithm to delete all the occurrences of a given value from the list.
13. List the different types of linked list & give their definitions in C.
14. Write an algorithm to count the number of nodes in a singly linked list.
15. Write an algorithm to reverse the linked list without creating new nodes.
16. Write an algorithm to append an element to the end of a list.
17.What is the advantage of Queue representing as List? For such representation
write the insertion and deletion procedure.
18.Show that output of the following assuming a = 4, b = 3, c = 10
1. d = a & b
2. d = a / b
3. d = a ^ b
4. d = a >>2
5. d = a<< 2
Part-B
1. What is Priority Queue? Explain the different methods of implementing Priority
queue & comment on the efficiency on each method.
2. What are the advantages of a doubly linked list over a singly linked list? Write a
program that inserts a given value in to an ordered doubly linked list in to its proper
positions.
11. 3. Write a C programme to implement Circular singly linked list.
4. Write a C programme using dynamic variables & pointers to construct a singly
linked list, consisting of following information.
1. Student ID.
2. Student Name.
3. Semester.
The operations to be supported are
1. Inserting at the front
2. At the end.
3. At any position.
4. Display all the nodes in the list.
5. Write a C programme using dynamic variables & pointers to construct a singly
linked list, consisting of following information.
1. Student ID.
2. Student Name.
3. Semester.
The operations to be supported are Deleting a node based on student ID.If the
specified node is not present in the list; an error message should be displayed. Both
options should be demonstrated.
6. Write a C programme using dynamic variables & pointers to construct a singly
linked list,consisting of following information.
1. Student ID.
2. Student Name.
3. Semester.
The operations to be supported are 1. Searching a node based on student ID &
updates the information content. If the specified node is not present in the list an
error message should be displayed. Both options should be displayed.
7. Write a C programme using dynamic variables & pointers to construct
8. What is a Linked list? Compare static & dynamic implementation of linked list in C.
9. How can an ordinary Queue is represented using a singly linked list ? Give
algorithms for insertions as well as deleting elements in to a singly linked list ?
10. What are different methods to represent a binary tree and compare them?
11. Given a binary tree implement the following.
1. To compute its maximum depth.
2. To Print the nodes in ascending order assuming that the tree is a BST.
3. To count the number of nodes in a binary tree.
12. Give an algorithm for constructing a binary search tree. While constructing the
tree take care that duplicate values are not added. Trace the algorithm on
8,13,10,12,6,9,5,2.
13. Wrtie an algorithms for implementing the following:
1. To concatinate two linked list.
2. Delete the first occurrence of value X from a doubly linked list.
3. Delete all the occurrence of given value from DLL.
14. What are the advantages & disadvantages of a doubly linked list over a singly
linked list .
15. What is meant by tree traversal. Explain the different traversal techniques.
12. 16. What are different schemes of representing a binary tree.
17. Define the following terms.
1. Strictly binary tree.
2. Complete binary tree.
3. Depth of a tree.
4. Binary search tree.
5. Almost complete binary tree.
18. What is meant by threaded binary tree? Explain the impact of such a
representation on the tree traversal procedure.
19. Write a program to insert a given value into an ordered singly linked list into its
proper position.
20. What is header node? Write a program to implement the circular singly linked
list. Perform insertion, deletion and display routines.
21. Construct a binary search tree for the following
1. 80,40,75,30,20,90,50
2. 100,50,200,25,90,80,150,300,180.
22. Construct the binary tree given the following traversals.
Pre-order : A B D G H C E I F
In-order: G D H B A E I C F
23. What is Structure? How is it different from an array? Expain the methods of
initiating the structre members with an illustrative example.
24. Distinguish between the following:
1. (*m) [5] and * m[5]
2. int ( * ptr ) and int * ptr( )
25. Develop a C program to write data of employees into a file. Each employee is a
structure with the following members: Char name[10], float salary, int id, char desig
[10]. Further read from the file and display it on the console.
26. What is stack? Indicate how stack is represented in C.
27. Write an algorithm for converting fix expression for postfix expression. Further
trace the above algorithm clearly indicating the contents of the stack for the
following expressions:
(( A – ( B + C )) * D ) $ ( E + F )
28. What is recursion? Comment on the efficiency of recursive routines.
29. Write a recursive C function to find the sum of all the elements in an array with N
integer values.
30. With an illustrative example, show a queue can be structured as a circular list.
31. Explain the working of radix sort on a suitable data set and comment on its
efficiency.
32. What is hashing? Explain various methods for resolving hash collisions.
13. 33. What are bit fields? Summarize the rules for defining and using bit fields with
suitable examples. Consider the following:
Struct
{
int count;
float *p;
s [20], *ptr = s;
write the impact of the following statements.
1. ++ ptr -> count;
2. *ptr -> p ++;
3. ( * ptr -> p ))++;
4. *ptr ++ ->;
5. ( ++ptr ) -> count;
34. What is a circular Queue ? Write the implementation of circular queues using
arrays,& also write the routines to perform insertion,deletion & display on it.
35. What is a Union ? With an example explain the declartion & accessing of union
members.
36. Write a syntax & purpose of the following library functions:
1. fopen
2. fseek
3. ftell
4. rewind
5. fscanf