3i Infotech Placement: Sample Questions 792 - 794 of 1245

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

Question 792

Describe in Detail

Essay▾

Traverse the given tree using Inorder, Preorder and postorder traversals.

Image Shows the Tree

Explanation

Inorder: D H B E A F C I G J

  • First, visit all nodes in the left subtree
  • Then the root node
  • Then the nodes in the right subtree

Preorder: A B D H E C F G I J

  • Visit root node
  • Then the nodes in the left subtree
  • After the node in the right subtree

Postorder: H D E B F I J G C A

  • Visit all the nodes in the left subtree
  • After the root node
  • Then the nodes in the right subtree

Question 793

Edit

Write in Short

Short Answer▾

How would you use qsort () function to sort the name stored in array of pointers to string?

Explanation

  • When qsort is called, it sorts the array into ascending order, calling the comparison function whenever it needs to compare array elements.
  • A call of qsort that sorts the inventory array looks like this:
  • Qsort (inventory, num_parts, sizeof (struct part) , compare_parts) . Here Compare_parts is a function that compares two part structures.

Question 794

Edit

Write in Short

Short Answer▾

What is symbolic links?

Explanation

  • Symbolic link is another name for file.
  • Contains reference to another file as absolute or relative path
  • Affects pathname resolution.
  • Transparent to users- links appear as normal files or directories, and acted upon by the user or application in exactly the same manner.
  • Aid in migration and application compatibility with UNIX operating systems.

Symbolic link are different from hard links.

  • Hard links always point to an existing file- symbolic links may contain an arbitrary path that does not point to anything.

Developed by: