100% found this document useful (1 vote)
676 views2 pages

Daalab

This document outlines 20 programming assignments for a Design and Analysis of Algorithms lab course. The assignments involve implementing various data structures and algorithms using C++, including stacks, queues, linked lists, binary search trees, graphs, sorting, shortest paths, knapsack problems, and traveling salesperson. Suggested reference books for the course are also listed.

Uploaded by

Srinivasa Rao G
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
676 views2 pages

Daalab

This document outlines 20 programming assignments for a Design and Analysis of Algorithms lab course. The assignments involve implementing various data structures and algorithms using C++, including stacks, queues, linked lists, binary search trees, graphs, sorting, shortest paths, knapsack problems, and traveling salesperson. Suggested reference books for the course are also listed.

Uploaded by

Srinivasa Rao G
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY

HYDERABAD
I Year M.Tech (CSE) I Semester

DESIGN AND ANALYSIS OF ALGORITHMS LAB (Through C++)

1. Write C++ programs to implement the following using an array.


a) Stack ADT
b) Queue ADT
2. Write C++ programs to implement the following using a singly linked list.
a) Stack ADT
b) Queue ADT
3. Write C++ program to implement the deque (double ended queue) ADT using a
doubly
linked list.
4. Write a C++ program to perform the following operations:
a) Insert an element into a binary search tree.
b) Delete an element from a binary search tree.
c) Search for a key element in a binary search tree.
5. Write a C++ program to implement circular queue ADT using an array.
6. Write a C++ program to implement all the functions of a dictionary (ADT) using
hashing.
7. Write a C++ program to perform the following operations on B-Trees and AVL-trees:
a) Insertion.
b) Deletion.
8. Write C++ programs for the implementation of bfs and dfs for a given graph.
9. Write C++ programs to implement the following to generate a minimum cost spanning
tree:
a) Prim’s algorithm.
b) Kruskal’s algorithm.
10.Write a C++ program to solve the single source shortest path problem.
(Note: Use Dijkstra’s algorithm).
11. Write C++ program that uses non-recursive functions to traverse a binary tree in:
a) Pre-order.
b) In-order.
c) Post-order.
12. Write C++ programs for sorting a given list of elements in ascending order using the
following sorting methods:
a) Quick sort.
b) Merge sort.

13.Write a C++ program to find optimal ordering of matrix multiplication. (Note: Use
Dynamic programming method).
14.Consider the problem of eight queens on an (8x8) chessboard. Two queens are said to
attack each other if they are on the same row, column, or diagonal. Write a C++ program
that implements backtracking algorithm to solve the problem i.e. place eight non-
attacking queens on the board.
15.Write a C++ program to find the strongly connected components in a digraph.
16.Write a C++ program to implement file compression (and uncompression) using
Huffman’s algorithm.
17.Write a C++ program to implement dynamic programming algorithm to solve the all
pairs shortest path problem.
18.Write a C++ program to solve 0/1 knapsack problem using the following:
a) Greedy algorithm.
b) Dynamic programming algorithm.
c) Backtracking algorithm.
d) Branch and bound algorithm.
19.Write a C++ program that uses dynamic programming algorithm to solve the optimal
binary search tree problem.
20.Write a C++ program for solving traveling sales persons problem using the following:
a) Dynamic programming algorithm.
b) The back tracking algorithm.
c) Branch and Bound.

Suggested Books for lab:


Data Structures, A Pseudocode Approach with C++, Richard F.Gilberg, Behrouz
A.Forouzan, Thomson. Data Structures Using C++, D.S.Malik, Thomson.

You might also like