GithubHelp home page GithubHelp logo

fbn776 / dslab-s3 Goto Github PK

View Code? Open in Web Editor NEW
5.0 0.0 0.0 43 KB

Repo containing the code for all exercises done in KTU 2019 S3 Data Structures lab

C 100.00%
c data-structures ktu ktu-s3-cse lab

dslab-s3's Introduction

Data Structures Lab - S3

Questions

Cycle - 1 (C lang review)

  1. You are given two arrays sorted in ascending order. Write a C Program to merge the elements of the two arrays and to form a single array sorted in ascending order.
  2. Given a string s, write a C program to find the length of the longest substring without repeating characters. Also, display the substring.
  3. Write a program to find the smallest number in a list of integers using pointers
  4. Implement the following string library functions using pointers:
    • string length (int StringLength (char *s))
    • string copy (void StringCopy(char *s1, char *s2))
    • string comparison (int StringCompare (char *s1, char *s2))
    • string concatenation (void StringConcat(char *s1, char *s2))
  5. Implement bubble sort without using an array (Use pointers instead)

Cycle - 2 (Search)

  1. Implement Linear Search.
  2. Implement Binary Search.
  3. Implement Stack using an array.
  4. Write a program in C to check whether a string is palindrome or not, using stack.

Cycle - 3

  1. Using stack, convert an infix expression to a postfix expression and evaluate the postfix expression.
  2. Write a program to convert an infix expression to a prefix expression using stack.
  3. Convert an infix expression to a postfix expression without using stack.
  4. Implement a Queue using arrays with the operations:
    • Insert elements into the queue
    • Delete elements from the queue
    • Display the contents of the queue after each operation
  5. Implement a Circular Queue using arrays with the operations:
    • Insert elements into the queue
    • Delete elements from the queue
    • Display the contents of the queue after each operation
  6. Implement a Priority Queue using arrays with the operations:
    • Insert elements into the queue
    • Delete elements from the queue
    • Display the contents of the queue after each operation
  7. Implement a Double-Ended Queue using arrays with the operations:
    • Insert elements into the queue (both front and size)
    • Delete elements from the queue (both front and size)
    • Display the contents of the queue after each operation

Cycle - 4

  1. Write a program to read two polynomials and store them in an array. Calculate the sum of the two polynomials and display the first polynomial, the second polynomial and the resultant polynomial.
  2. Write a program to enter two matrices in normal form. Write a function to convert two matrices to a tuple form and display it. Also, find the transpose of the two matrices represented in tuple form and display it. Find the sum of the two matrices in tuple form and display the sum in tuple form.

Cycle - 5

  1. Write a menu-driven program for performing the following operations on a linked list
    1. Display
    2. Insert at beginning
    3. Insert at the end
    4. Insert at a specified position
    5. Delete from the beginning
    6. Delete from the end
    7. Delete from a specified position
  2. Create a doubly linked list from a string taking each character from the string. Check if the string is palindrome in an efficient method.
  3. Implement a stack using a linked list with the operations:
    1. Push
    2. Pop
    3. Display the contents of the stack
  4. Implement a queue using linked lists with the following operations
    1. Enqueue
    2. Dequeue
    3. Display the contents of the queue
  5. Write a program to reverse the contents of a queue using stack
  6. Write a program to read two polynomials and store them using a linked list. Calculate the sum of the two polynomials and display the first polynomial, the second polynomial and the resultant polynomial.
  7. Write a program to read two polynomials and store them using a linked list. Calculate the product of the two polynomials and display the first polynomial, the second polynomial and the resultant polynomial.
  8. Write a program for addition of polynomials containing two variables using a linked list. The terms of the polynomials are ordered by the power of the first variable and then the second variable, in the descending order. Eg: 4.x^3.y^1 + 2.x^2.y^3 + 5.x^1.y^2+7.y^2+7.y^1+5

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.