Showing posts with label Data Structures - Unit 4. Show all posts
Showing posts with label Data Structures - Unit 4. Show all posts

Saturday, November 15, 2014

Data Structures - Unit 4

1.Explain heap sort with an example? 

• Explanation
• Example
• Figure
• Coding

2. Explain quick sort with an example? 
• Explanation
• Example
• Figure
• Coding

3. Explain quick sort with an example? 
• Explanation
• Example
• Figure
• Coding

4. Explain any four external sorting techniques with example? 
•Explanation
• Example
• Figure
• Coding

5. Explain shell sort with an example? 
• Explanation
• Example
• Figure
• Coding

Friday, November 14, 2014

Data Structures - Unit 4

1. What i the advantage of quick sort? 
Quick sort reduces unnecessary swaps and moves an item to a greater distance, in one move.

2. What is the average efficiency of heap sort? 
The average efficiency of heap sort is 0 (n(log2 n)) where, n is the number of elements sorted.

3. Define segment? 
When large blocks of data are to be sorted, only a portion of the block or file is loaded in the main memory of the computer since, it cannot hold the entire block. This small portion of file is called a segment.

4. Name some of the external sorting methods? 
a. Polyphase merging
b. Oscillation sorting
c. Merge sorting

5. When is a sorting method said to be stable? 
A sorting method is said to be stable, it two data items of matching values are guaranteed to be not rearranged with respect to each other as the algorithm progresses.

Wednesday, October 29, 2014

Data Structures - Unit 4


1.What is meant by sorting? 


Ordering the data in an increasing or decreasing fashion according to some relationship among the data item is called sorting.

2. What are the two main classifications of sorting based on the source of data? 
a. Internal sorting
b. External sorting

3. What is meant by external sorting? 
External sorting is a process of sorting in which large blocks of data stored in storage devices are moved to the main memory and then sorted.

4. What is meant by internal sorting? 
Internal sorting is a process of sorting the data in the main memory.

5. What are the various factors to be considered in deciding a sorting algorithm? 
a. Programming time
b. Execution time of the program
c. Memory needed for program environment