Data Structures and Algorithms Assignment 1

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to Lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

What is the main purpose of Radix sort in data structures?

  • To convert a binary tree into a binary search tree.
  • To sort numbers based on their individual digits. (correct)
  • To efficiently merge two sorted lists.
  • To quickly find the maximum element in an array.

What is the primary output when splitting a circular linked list into two halves?

  • One circular linked list with all elements reversed.
  • Two linear linked lists that contain the same elements.
  • Two separate circular linked lists of equal length. (correct)
  • A single linear list with elements sorted.

In the context of wildcard patterns, what does the '?' character represent?

  • A placeholder for any single binary digit. (correct)
  • A fixed binary digit that cannot be changed.
  • An indication of an error in the pattern.
  • A marker for the start of the binary string.

What data structure is typically used in Dijkstra's algorithm to efficiently select the next vertex with the smallest tentative distance?

<p>Priority queue (B)</p> Signup and view all the answers

Which of the following best describes the output of the binary string combinations from the wildcard pattern '1?11?00?1?'?

<p>Multiple unique binary strings can be formed by varying the '?' characters. (C)</p> Signup and view all the answers

Flashcards are hidden until you start studying

Study Notes

Assignment 1 Topics

  • The assignment is worth 10 marks and contains 4 parts.
  • The assignment requires students to write C programs for four different data structures and algorithms concepts.
  • The questions are:
    • Implement Radix sort.
    • Split a Circular Linked List into two halves.
    • Find all binary strings that can be formed from a wildcard pattern.
    • Implement Dijkstra's shortest path algorithm using a priority queue.

Radix Sort

  • Radix sort is a sorting algorithm that sorts data by digit or character position.
  • The assignment requires students to write a C program that implements radix sort.

Circular Linked List

  • A circular linked list is a data structure where the last node points back to the first node, creating a loop.
  • The assignment requires students to write a C program that splits a circular linked list into two halves.

Wildcard Pattern Binary Strings

  • The assignment requires students to find all possible combinations of binary strings that can be formed by replacing the wildcard character ('?') with either '0' or '1' in a given binary pattern.
  • For example, for the wildcard pattern "1?11?00?1?", the possible combinations are:
    • "1011000010"
    • "1011000011"
    • "1011000110"

Dijkstra's Algorithm

  • Dijkstra's algorithm is a graph traversal algorithm that finds the shortest path between two nodes in a graph.
  • The assignment requires students to write a C program that implements Dijkstra's shortest path algorithm using a priority queue.

Studying That Suits You

Use AI to generate personalized quizzes and flashcards to suit your learning preferences.

Quiz Team

Related Documents

Sem_3_DS_Assignment.docx
Use Quizgecko on...
Browser
Browser