Basic CS-Data Structures [3i Infotech Placement]: Sample Questions 48 - 49 of 52

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 48

Data Structures
Edit

Describe in Detail

Essay▾

Difference between arrays and linked list?

Explanation

Understanding of Array & Linked List
Difference between Arrays and Linked List
ArrayLink list
It is a consistent set of a fixed number of data items.It is an ordered set consisting of a variable number of data items.
Size is specified during declaration.Size is not specified, allocated during execution.
Element location is allocated during compile time.Element position is assigned during run time
Stored consecutivelyStored randomly
Slow relatively as shifting is requiredEasier, fast and efficient.
Memory required is lessMemory required is more
Memory utilization is ineffective as contiguous block is allocated.Memory utilization is efficient as continuous block is not allocated

Question 49

Data Structures
Edit

Describe in Detail

Essay▾

For the following COBOL code, draw the Binary tree?

01 STUDENT_REC.

02 NAME.

03 FIRST_NAME PIC X (10) .

03 LAST_NAME PIC X (10) .

02 YEAR_OF_STUDY.

03 FIRST_SEM PIC XX.

03 SECOND_SEM PIC XX.

Explanation

Binary Tree of COBOL Code
  • Root node with data = STUDENT_REC- All data elements are under STUDENT_REC
  • Data in the left subtree is: [NAME, FIRST NAME, LAST NAME] with NAME again broken into FIRSR NAME and LAST NAME.
  • Data in the right subtree is: [YEAR OF STUDY, FIRST SEM SECOND SEM] with YEAR OF STUDY having two components FIRST SEM and SECOND SEM.

Developed by: