Posts

Showing posts from December, 2021

Basic concept of OOP in c++

                              Some  Basic concept of OOP in c++  C++ What is OOP ? OOP stands for Object-Oriented Programming. Object Oriented Programming is a paradigm that provides many concepts such as  inheritance, data binding, polymorphism etc. Object-oriented programming has several advantages over procedural programming:      1. OOP is faster and easier to execute.       2. OOP provides a clear structure for the programs.       3. OOP helps to keep the C++ code DRY "Do not Repeat Yourself", and makes the code easier to maintain, modify and debug. C++ What are Classes and Objects? Class When you define a class, you define a blueprint for an object. This doesn't actually define any data, but it does define what the class name means, that is, what an object of the class will consist of and what operations can be performed on such an object...

Method to find if a subtree in a binary tree is a BST ....

                                                                         csl210_lab2b.h /**  * Lab assignment 2b  * CSL 210 2021  * Deadline: Sunday Oct 10 11pm.  * Submit the c implementation file for this header file  * Filename should be of format YourEnrollmentNumber_lab2b.c (lower case); e.g., bt20cse999_lab2b.c  *  *   * Compilation error = 0  * Late submission = 0  * Presence of uncommented main function in the submission file = 0  * Cheating/plagiarism = 0  * */ #define EMPTYNODE 0 struct btNode{     short value;     struct btNode* left;     struct btNode* right; }; typedef struct btNode btNode_t; /**  * Method to find if a subtree in a binary tree is a BST   *   * For this funct...

Method to convert a BST to Quad Tree.....

                                                            csl210_lab2a.h /**  * Lab assignment 2a  * CSL 210 2021  * Deadline: Sunday Oct 10 11pm.  * Submit the c implementation file for this header file  * Filename should be of format YourEnrollmentNumber_lab2a.c (lower case); e.g., bt20cse999_lab2a.c  *  *   * Compilation error = 0  * Late submission = 0  * Presence of uncommented main function in the submission file = 0  * Cheating/plagiarism = 0  * */ #define EMPTYNODE 0 struct bstNode{     short value;     struct bstNode* left;     struct bstNode* right; }; typedef struct bstNode bstNode_t; struct quadNode{     short value;     struct quadNode* child0; // leftmost     struct quadNode* child1; // next to the le...

Method to create binary tree for huffman coding from the given input character sequence .......

                                                                csl210_lab3.h   /**  * Lab assignment 3  * CSL 210 2021  * Deadline: Friday Oct 29 11pm.  * Submit the c implementation file for this header file  * Filename should be of format YourEnrollmentNumber_lab3.c (lower case); e.g., bt20cse999_lab3.c  *  *   * Compilation error = 0  * Late submission = 0  * Presence of uncommented main function in the submission file = 0  * Cheating/plagiarism = 0  * */ #define EMPTYNODE 0 struct btNode{     unsigned short frequency;     char value;     struct btNode* left;     struct btNode* right; }; typedef struct btNode btNode_t; /**  * Method to create binary tree for huffman coding from the given input character sequence...