Write a C program to Implement Bubble Sort. |
|
University | Amity blog |
Service Type | Assignment |
Course | |
Semester | |
Short Name or Subject Code | Data and File Structure using C |
Product | of Assignment (Amity blog) |
Pattern | Section A,B,C Wise |
Price | Click to view price |
Data and File Structure using C
ASSIGNMENT A-
1. A two-dimensional array defined as a [4…7, -1 …….3] requires 2 bytes of storage space for each element. If the array is stored in row-major form, then calculate the address of element at location a[6,2]. Give the base address is 100.
2. Write a C program to implement bubble sort.
3. Write a program in C to show PUSH and POP operations in a stack.
4. Write the algorithms for the insertion and deletion operations performed on the circular queue.
5. What is double linked list? What are the advantage and disadvantage of double linked list?
6. What is a binary search tree? Construct a binary search tree from these numbers – 50, 30, 60, 22, 38, 55, 34.
7. Explain the Dijkastra’s Algorithm.
8. What do you mean by the Hashing? Explain different method of hashing.
ASSIGNMENT B-
1. If you are using C language to implement the heterogeneous linked list, what pointer type will you use?
2. What is the binary tree? What are threaded and properties of binary trees?
3. What is directed graph? Explain the various types of graph and traversal of directed graph.
ASSIGNMENT C-
1. The memory address of the first element of an array is called
Options
Floor Address
Foundation Address
First Address
Base Address
2. Memory address of fifth element of an array can be calculated by the formula
Options
LOC(Array[5]=Base(Array)+w(5-lower bound), where w is the number of words per memory cell for the array
LOC(Array[5])=Base(Array[5])+(5-lower bound), where w is the number of words per memory cell for the array
LOC(Array[5])=Base(Array[4])+(5-Upper bound), where w is the number of words per memory cell for the array
None of above
3. Which of the following data structures are indexed structures?
Options
linear arrays
linked lists
both of above
none of above
4. Which of the following is not the required condition for binary search algorithm?
Options
The list must be sorted
There should be the direct access to the middle element in any sublist
There must be mechanism to delete and/or insert elements in list
none of above
5. Which of the following is not a limitation of binary search algorithm?
Options
Must use a sorted array
requirement of sorted array is expensive when a lot of insertion and deletions are
There must be a mechanism to access middle element directly
Binary search algorithm is not efficient when the data elements are more than
6. Two dimensional arrays are also called
Options
Tables arrays
Matrix Arrays
both of above
none of above
7. A variable P is called pointer if
Options
P contains the address of an element in DATA.
P points to the address of first element in DATA
P can store only memory addresses
P contain the DATA and the address of DATA
8. Which of the following data structure can't store the non-homogeneous data elements?
Options
Arrays
Records
Pointers
None
9. Which of the following data structure store the homogeneous data elements?
Options
Arrays
Records
Pointers
None
10. Each data item in a record may be a group item composed of sub-items; those items which are indecomposable are called
Options
Elementary items
Atoms
Scalars
All of above
11. The difference between linear array and a record is
Options
An array is suitable for homogeneous data but the data items in a record may have
In a record, there may not be a natural ordering in opposed to linear array.
A record form a hierarchical structure but a lienear array does not
All of above
12. Which of the following statement is false?
Options
Arrays are dense lists and static data structure
data elements in linked list need not be stored in adjecent space in memory
pointers store the next data element of a list
linked lists are collection of the nodes that contain information part and next pointer
13. Binary search algorithm can not be applied to
Options
Sorted linked list
Sorted binary trees
Sorted linear array
Pointer array
14. When new data are to be inserted into a data structure, but there is no available space; this situation is usually called
Options
Underflow
Overflow
Houseful
Saturated
15. The situation when in a linked list START=NULL is
Options
Underflow
Overflow
Housefull
Saturated
16. Which of the following is two way lists?
Options
grounded header list
circular header list
linked list with header and trailer nodes
none of above
17. Which of the following name does not relate to stacks?
Options
FIFO lists
LIFO list
Piles
Push-down lists
18. The term "push" and "pop" is related to the
Options
Array
Lists
Stacks
All Of Above
19. A data structure where elements can be added or removed at either end but not in the middle
Options
Linked lists
Stacks
Queues
Deque
20. When in order traversing a tree resulted E A C K F H D B G; the preorder traversal would return
Options
FAEKCDBHG
FAEKCDHGB
EAFKHDCBG
FEAKDCHBG
21. Value of the first linked list index is________
Options
One
Zero
–1
None of these
22. A linked list index is ____ that represents the position of a node in a linked list
Options
An Integer
A variable
A character
A Boolean
23. Why is the constructor of the Queue Linked List class empty?
Options
Because initialization of data members of the Linked List class is performed by the constructor of the Linked List class.
Because initialization of data members of the Linked List class is performed by the destructor of the Linked List class.
Because initialization of data members of the Queue Linked List class is performed by the constructor of the Linked List class.
Because initialization of data members of the Queue Linked List class is performed by the destructor of the Linked List class
24. _______ form of access is used to add and remove nodes from a queue
Options
LIFO Last In First Out
FIFO, First In First Out
Both 1 and 2
None of these
25. ______ form of access is used to add and remove nodes from a stack
Options
LIFO
FIFO
Both 1 and 2
None of these
26. New nodes are added to the _____ of the queue.
Options
Front
Back
Middle
Both 1 and 2
27. A _______ is a data structure that organizes data similar to a line in the supermarket, where the first one in line is the first one out.
Options
Queue linked list
Stacks linked list
Both of them
Neither of them
28. In an array queue, data is stored in an _____ element
Options
Node
Linked list
Array
Constructor
29. The pop () member function determines if the stack is empty by calling the _____ member function
Options
removeback()
isEmpty()
removedfront()
hasNext()
30. What happens when you push a new node onto a stack?
Options
The new node is placed at the front of the linked list
The new node is placed at the back of the linked list.
The new node is placed at the middle of the linked list.
No Changes happens
31. Which of the following algorithm solves the all – pair shortest path problem?
Options
Dijkstra,s algorithm
Floyd’s algorithm
Prim’s algorithm
Warshall’s algorithm
32. The operation of processing each element in the list is known as
Options
Sorting
Merging
Inserting
Traversal
33. To delete a dynamically allocated array named `a`, the correct statement is
Options
delete a;
delete a[0];
delete []a;
delete [0]a;
34. The memory address of the first element of an array is called
Options
Floor address
Foundation address
First address
Base address
35. Which of the following data structure store the homogeneous data elements?
Options
Arrays
Records
Pointers
None
36. The number of possible binary trees with 4 nodes is
Options
12
13
14
15
37. Which of the following data structure is not linear data structure?
Options
Arrays
Linked lists
Both of above
None of above
38. Finding the location of the element with a given value is:
Options
Traversal
Search
Sort
None of above
39. Preorder is same as
Options
depth-first order
breadth- first order
topological order
linear order
40. Which of the following is the feature of stack?
Options
All operations are at one end
It cannot reuse its memory
All elements are of different data types
Any element can be accessed from it directly