Object Oriented Programming Using C++ Practical FileHarjinder Singh
This document contains a practical file submitted by Jasbir Singh for an Object Oriented Programming course using C++. It includes an acknowledgement page thanking various people for their support and guidance. The document then provides a table of contents listing 53 programs with their page numbers and brief descriptions. The programs demonstrate various C++ concepts like classes, objects, inheritance, polymorphism, operator overloading and more.
The document describes programs to implement various operations on singly linked lists including insertion, deletion, counting nodes, creating a list, traversing a list, and copying a list. It provides functions for insertion at the beginning, end, and before/after a given node. Deletion functions remove from the beginning, end, or by item value. Counting returns the total nodes or occurrences of a value. Traversal and copying print or duplicate the list.
This document discusses competitive programming (CP). It defines CP as a "mind sport" involving problem solving under constraints, not a computer engineering field. The goal of CP is to increase logical ability and write code for challenging situations. Reasons to do CP include it being trendy now and to improve problem solving and data structures and algorithms (DSA) skills. The roadmap involves learning time/space complexity, selecting a language, learning DSA, and practicing problems. Benefits include helping with coding interviews, improving problem solving, adding skills to one's resume, and demonstrating abilities publicly. To be a CP master requires practice.
Lab manual data structure (cs305 rgpv) (usefulsearch.org) (useful search)Make Mannan
This document provides a lab manual for experiments on data structures. It includes 20 experiments covering topics like arrays, matrices, recursion, strings, stacks, queues, linked lists, trees, graphs and sorting algorithms. Each experiment contains the aim, introduction, source code, sample output and questions. The experiments provide hands-on practice with commonly used data structures and algorithms.
Railway management system, database mini projectshashank reddy
This document describes a database project for a railway reservation system. It includes entities like users, passengers, trains, stations, tickets. It provides the entity relationship diagram and normalized database schema. It also includes sample SQL commands to create the tables and insert sample data into the tables. The tables created are for users, trains, stations, train status, tickets, passengers and relationship tables for starts, reaches, stops_at and books.
This document provides an introduction to operating systems. It defines an operating system as a program that acts as an intermediary between the user and computer hardware. The key components of a computer system are described as hardware, operating system, application programs, and users. Operating systems manage resources, control programs, and provide common services like memory management, process management, and I/O management. Various computing environments are explored, including traditional systems, mobile systems, distributed systems, client-server models, and virtualization.
This document discusses graph data structures and algorithms. A graph consists of nodes and edges, where nodes represent entities and edges represent relationships between nodes. There are different types of graphs including undirected, directed, weighted, and cyclic graphs. Graphs can be represented using an adjacency matrix or adjacency list. Graphs are used to model real-world networks and solve problems in areas like social networks, maps, robot path planning, and neural networks.
The document discusses minimum spanning trees (MST) and two algorithms for finding them: Prim's algorithm and Kruskal's algorithm. Prim's algorithm operates by building the MST one vertex at a time, starting from an arbitrary root vertex and at each step adding the cheapest connection to another vertex not yet included. Kruskal's algorithm finds the MST by sorting the edges by weight and sequentially adding edges that connect different components without creating cycles.
This program allows a user to collect personal, educational, and professional information from a candidate to automatically generate a resume in rich text format (RTF). The program includes controls to dynamically add additional educational courses and work experiences. It collects information such as name, date of birth, address, education history, work experience, skills and generates an RTF resume file with the collected information.
This document contains some programs of C using Data structures, like Stack, LinkedList, queue, Fibonacci series, addition and multiplication of two matrices,etc.
Two dimensional arrays in C can be declared and initialized similarly to one dimensional arrays, with the first subscript specifying the row and second subscript specifying the column. Elements are stored in contiguous memory locations in row-major order. The document then presents a sample problem of reading a 2D array of integers from a file, finding the largest element, and printing it out. It also discusses using typedef to define custom data types like matrices and strings.
The document contains 10 programs related to sorting and graph algorithms. Program 1-7 implement different sorting algorithms - insertion sort, selection sort, heap sort, quick sort, counting sort, merge sort and radix sort. Program 8 implements the greedy knapsack problem. Program 9 implements the travelling salesman problem. Program 10 implements Kruskal's algorithm to find the minimum spanning tree of a graph.
- A structure is a user-defined data type that groups logically related data items of different data types into a single unit. Structures allow related data to be accessed and managed together.
- Structures can contain nested structures as members. Nested structure members are accessed using two period operators (e.g. e1.doj.day).
- Structures can be passed to functions as parameters and returned from functions. Pointers to structures are declared and accessed using arrow (->) operator instead of period operator.
- A union shares the same memory space for multiple data types, allocating only enough space for its largest member. Unions allow different types to share the same memory location.
The document contains 34 code snippets showing C programming examples using arrays, loops, functions, conditional statements, and other basic programming concepts. The code snippets demonstrate how to:
1) Print messages, take user input, perform basic math operations like addition and averaging numbers
2) Check conditions like even/odd, positive/negative, leap year
3) Use different loops like while, for, do-while to iterate
4) Define and call functions to modularize code for swapping, factorial, Fibonacci series etc.
5) Use one-dimensional arrays to store and process data
This document discusses two-dimensional arrays. It begins by defining two-dimensional arrays as arrangements of elements in rows and columns with two indices - one for the row and one for the column. It then covers declaring, initializing, accessing, inputting, outputting, and performing operations on two-dimensional arrays and matrices. Specific operations discussed include traversing arrays, summing row/column elements, and performing operations on matrices like finding diagonal sums and adding matrices.
This document discusses stacks and queues as linear data structures. It defines stacks as last-in, first-out (LIFO) collections where the last item added is the first removed. Queues are first-in, first-out (FIFO) collections where the first item added is the first removed. Common stack and queue operations like push, pop, insert, and remove are presented along with algorithms and examples. Applications of stacks and queues in areas like expression evaluation, string reversal, and scheduling are also covered.
A list in Python is a mutable ordered sequence of elements of any data type. Lists can be created using square brackets [] and elements are accessed via indexes that start at 0. Some key characteristics of lists are:
- They can contain elements of different types
- Elements can be modified, added, or removed
- Common list methods include append(), insert(), remove(), pop(), and sort()
This document discusses MySQL databases and how to interact with them using PHP. It begins by introducing MySQL as the world's most popular open source database and describes some basic database server concepts. It then provides code examples for how to connect to a MySQL database from PHP, select a database, perform queries to read, insert, update, and delete records, and more. The document is intended as a tutorial for learning the basic functions and syntax for accessing and manipulating data in a MySQL database with PHP.
The document discusses file handling in Python. It explains that a file is used to permanently store data in non-volatile memory. It describes opening, reading, writing, and closing files. It discusses opening files in different modes like read, write, append. It also explains attributes of file objects like name, closed, and mode. The document also covers reading and writing text and binary files, pickle module for serialization, and working with CSV files and the os.path module.
The document discusses various string manipulation techniques in Python such as getting the length of a string, traversing strings using loops, slicing strings, immutable nature of strings, using the 'in' operator to check for substrings, and comparing strings. Key string manipulation techniques covered include getting the length of a string using len(), extracting characters using indexes and slices, traversing strings with for and while loops, checking for substrings with the 'in' operator, and comparing strings.
An array is a collection of elements of the same type stored in contiguous memory locations that can be accessed using an index. Arrays allow storing multiple values as a single variable. One-dimensional arrays store elements in a list, while multi-dimensional arrays arrange elements in multiple dimensions. Elements are accessed using their position indices, which must be within the array bounds. Arrays can be initialized during declaration and values accessed using loops. Operations like input, output and searching are commonly performed on array elements.
String literals in python are surrounded by either single quotation marks, or double quotation marks. Strings can be output to screen using the print function. For example: print("hello"). Like many other popular programming languages, strings in Python are arrays of bytes representing unicode characters.
The document discusses strings in C programming. It defines strings as sequences of characters stored as character arrays that are terminated with a null character. It covers string literals, declaring and initializing string variables, reading and writing strings, and common string manipulation functions like strlen(), strcpy(), strcmp(), and strcat(). These functions allow operations on strings like getting the length, copying strings, comparing strings, and concatenating strings.
Classes allow users to bundle data and functions together. A class defines data members and member functions. Data members store data within each object, while member functions implement behaviors. Classes support access specifiers like public and private to control access to members. Objects are instances of classes that allocate memory for data members. Member functions can access object data members and are called on objects using dot notation. Friend functions allow non-member functions to access private members of classes.
This document discusses strings and string buffers in Java. It defines strings as sequences of characters that are class objects implemented using the String and StringBuffer classes. It provides examples of declaring, initializing, concatenating and using various methods like length(), charAt() etc. on strings. The document also introduces the StringBuffer class for mutable strings and lists some common StringBuffer functions.
A set is an unordered collection of unique and immutable elements that can be of different types. Sets can contain elements of different types but not mutable elements like lists. We can perform operations like union, intersection, symmetric difference on sets. Sets are mutable, meaning we can add or remove elements, but cannot access elements by index since sets are unordered.
1. The document contains 10 code snippets implementing various data structures and algorithms in C/C++ like linear search, binary search, merge sort, quick sort, selection sort, bubble sort, stack implementation using array, Fibonacci series using recursion, queue implementation using array, and binary search tree operations like insertion, deletion, display and traversal.
2. The codes include functions for searching an element, sorting arrays, implementing stacks and queues as well as common operations on binary search trees.
3. Main functions are included to accept user input, call the relevant functions and output the results of operations like searching, sorting or tree traversals.
The documents contain program code snippets for various sorting and searching algorithms in C programming language including selection sort, bubble sort, quick sort, merge sort, insertion sort, binary search and linear search. The programs take input from the user, implement the respective algorithms to sort or search arrays of numbers, and output the results.
This program allows a user to collect personal, educational, and professional information from a candidate to automatically generate a resume in rich text format (RTF). The program includes controls to dynamically add additional educational courses and work experiences. It collects information such as name, date of birth, address, education history, work experience, skills and generates an RTF resume file with the collected information.
This document contains some programs of C using Data structures, like Stack, LinkedList, queue, Fibonacci series, addition and multiplication of two matrices,etc.
Two dimensional arrays in C can be declared and initialized similarly to one dimensional arrays, with the first subscript specifying the row and second subscript specifying the column. Elements are stored in contiguous memory locations in row-major order. The document then presents a sample problem of reading a 2D array of integers from a file, finding the largest element, and printing it out. It also discusses using typedef to define custom data types like matrices and strings.
The document contains 10 programs related to sorting and graph algorithms. Program 1-7 implement different sorting algorithms - insertion sort, selection sort, heap sort, quick sort, counting sort, merge sort and radix sort. Program 8 implements the greedy knapsack problem. Program 9 implements the travelling salesman problem. Program 10 implements Kruskal's algorithm to find the minimum spanning tree of a graph.
- A structure is a user-defined data type that groups logically related data items of different data types into a single unit. Structures allow related data to be accessed and managed together.
- Structures can contain nested structures as members. Nested structure members are accessed using two period operators (e.g. e1.doj.day).
- Structures can be passed to functions as parameters and returned from functions. Pointers to structures are declared and accessed using arrow (->) operator instead of period operator.
- A union shares the same memory space for multiple data types, allocating only enough space for its largest member. Unions allow different types to share the same memory location.
The document contains 34 code snippets showing C programming examples using arrays, loops, functions, conditional statements, and other basic programming concepts. The code snippets demonstrate how to:
1) Print messages, take user input, perform basic math operations like addition and averaging numbers
2) Check conditions like even/odd, positive/negative, leap year
3) Use different loops like while, for, do-while to iterate
4) Define and call functions to modularize code for swapping, factorial, Fibonacci series etc.
5) Use one-dimensional arrays to store and process data
This document discusses two-dimensional arrays. It begins by defining two-dimensional arrays as arrangements of elements in rows and columns with two indices - one for the row and one for the column. It then covers declaring, initializing, accessing, inputting, outputting, and performing operations on two-dimensional arrays and matrices. Specific operations discussed include traversing arrays, summing row/column elements, and performing operations on matrices like finding diagonal sums and adding matrices.
This document discusses stacks and queues as linear data structures. It defines stacks as last-in, first-out (LIFO) collections where the last item added is the first removed. Queues are first-in, first-out (FIFO) collections where the first item added is the first removed. Common stack and queue operations like push, pop, insert, and remove are presented along with algorithms and examples. Applications of stacks and queues in areas like expression evaluation, string reversal, and scheduling are also covered.
A list in Python is a mutable ordered sequence of elements of any data type. Lists can be created using square brackets [] and elements are accessed via indexes that start at 0. Some key characteristics of lists are:
- They can contain elements of different types
- Elements can be modified, added, or removed
- Common list methods include append(), insert(), remove(), pop(), and sort()
This document discusses MySQL databases and how to interact with them using PHP. It begins by introducing MySQL as the world's most popular open source database and describes some basic database server concepts. It then provides code examples for how to connect to a MySQL database from PHP, select a database, perform queries to read, insert, update, and delete records, and more. The document is intended as a tutorial for learning the basic functions and syntax for accessing and manipulating data in a MySQL database with PHP.
The document discusses file handling in Python. It explains that a file is used to permanently store data in non-volatile memory. It describes opening, reading, writing, and closing files. It discusses opening files in different modes like read, write, append. It also explains attributes of file objects like name, closed, and mode. The document also covers reading and writing text and binary files, pickle module for serialization, and working with CSV files and the os.path module.
The document discusses various string manipulation techniques in Python such as getting the length of a string, traversing strings using loops, slicing strings, immutable nature of strings, using the 'in' operator to check for substrings, and comparing strings. Key string manipulation techniques covered include getting the length of a string using len(), extracting characters using indexes and slices, traversing strings with for and while loops, checking for substrings with the 'in' operator, and comparing strings.
An array is a collection of elements of the same type stored in contiguous memory locations that can be accessed using an index. Arrays allow storing multiple values as a single variable. One-dimensional arrays store elements in a list, while multi-dimensional arrays arrange elements in multiple dimensions. Elements are accessed using their position indices, which must be within the array bounds. Arrays can be initialized during declaration and values accessed using loops. Operations like input, output and searching are commonly performed on array elements.
String literals in python are surrounded by either single quotation marks, or double quotation marks. Strings can be output to screen using the print function. For example: print("hello"). Like many other popular programming languages, strings in Python are arrays of bytes representing unicode characters.
The document discusses strings in C programming. It defines strings as sequences of characters stored as character arrays that are terminated with a null character. It covers string literals, declaring and initializing string variables, reading and writing strings, and common string manipulation functions like strlen(), strcpy(), strcmp(), and strcat(). These functions allow operations on strings like getting the length, copying strings, comparing strings, and concatenating strings.
Classes allow users to bundle data and functions together. A class defines data members and member functions. Data members store data within each object, while member functions implement behaviors. Classes support access specifiers like public and private to control access to members. Objects are instances of classes that allocate memory for data members. Member functions can access object data members and are called on objects using dot notation. Friend functions allow non-member functions to access private members of classes.
This document discusses strings and string buffers in Java. It defines strings as sequences of characters that are class objects implemented using the String and StringBuffer classes. It provides examples of declaring, initializing, concatenating and using various methods like length(), charAt() etc. on strings. The document also introduces the StringBuffer class for mutable strings and lists some common StringBuffer functions.
A set is an unordered collection of unique and immutable elements that can be of different types. Sets can contain elements of different types but not mutable elements like lists. We can perform operations like union, intersection, symmetric difference on sets. Sets are mutable, meaning we can add or remove elements, but cannot access elements by index since sets are unordered.
1. The document contains 10 code snippets implementing various data structures and algorithms in C/C++ like linear search, binary search, merge sort, quick sort, selection sort, bubble sort, stack implementation using array, Fibonacci series using recursion, queue implementation using array, and binary search tree operations like insertion, deletion, display and traversal.
2. The codes include functions for searching an element, sorting arrays, implementing stacks and queues as well as common operations on binary search trees.
3. Main functions are included to accept user input, call the relevant functions and output the results of operations like searching, sorting or tree traversals.
The documents contain program code snippets for various sorting and searching algorithms in C programming language including selection sort, bubble sort, quick sort, merge sort, insertion sort, binary search and linear search. The programs take input from the user, implement the respective algorithms to sort or search arrays of numbers, and output the results.
The document contains code for implementing various sorting algorithms in C including heapsort, quicksort, insertion sort, bubble sort, selection sort, and merge sort. For each algorithm, the code is provided to sort an integer array, take user input for the array elements, run the sorting algorithm, and output the sorted array. Sample outputs are also provided showing the input and sorted output arrays for each algorithm.
1. The document provides code snippets for implementing various sorting algorithms including heap sort, quicksort, merge sort, radix sort, bucket sort, and insertion sort. It also includes code for graph algorithms like Dijkstra's algorithm, Warshall's algorithm, and the knapsack problem using dynamic programming.
The program takes input of the order of a square matrix and its elements. It prints the elements of the matrix. It then calculates the trace of the matrix by adding the elements along the principal diagonal and prints the trace. The matrix elements are freed at the end.
The document contains 8 questions related to data structures and algorithms in C programming. Question 1 asks to write a program to search a number from a list using linear and binary search. Question 2 asks to write a program to search a number recursively using binary search. Question 3 asks to write a program to find the factorial of a number recursively and non-recursively and compare performance. The remaining questions ask to write programs for sorting, matrix multiplication using Strassen's algorithm, minimum spanning tree using Kruskal's algorithm, and other algorithms.
The program demonstrates queue operations like creation, insertion, deletion and listing using an array to implement the queue. It initializes the front and rear pointers of the queue to -1. It then provides a menu to perform queue operations and displays the output of each operation like listing the elements after insertion or displaying the deleted element.
The document contains programs for various sorting and searching algorithms like insertion sort, selection sort, bubble sort, linear search, binary search, etc. It also includes programs for stack operations, queue operations, tower of Hanoi, infix to postfix conversion and postfix evaluation. Each program is written in C language and contains the main logic/code to implement the given algorithm or data structure operation.
The document contains questions and program code snippets related to data structures and algorithms topics.
1) The first section contains a program to remove negative values from a queue using arrays as the underlying data structure.
2) The second section shows functions to implement enqueue, dequeue and display operations on a circular queue using arrays.
3) The third section contains a program to implement an ascending priority queue as a linked list.
The document describes three different sorting algorithms: linear search, binary search, and insertion sort. Linear search iterates through an array sequentially to find a target value. Binary search divides the array in half on each step to quickly locate a value. Insertion sort iterates through the array and inserts each element into the sorted portion, building up the sorted array.
This document provides C programs to implement various data structures and algorithms. It is divided into two parts. Part A includes programs to find GCD using recursion, generate Pascal's triangle using binomial coefficients, find Fibonacci numbers recursively, implement Towers of Hanoi recursively, find the largest and smallest element in an array, write even and odd numbers to separate files, store student records in a file, and sort city names alphabetically. Part B includes programs to sort arrays using insertion, quick, merge, selection and bubble sort and perform linear and binary searches recursively. It also includes programs to implement stacks, queues, linked lists and binary trees.
The document provides examples of basic C programs that demonstrate fundamental programming concepts like printing values, arithmetic operations, arrays, functions, conditionals, loops, and matrices. The programs cover topics such as printing and reading integers, adding/multiplying numbers, swapping values, checking vowels/consonants, Armstrong numbers, palindromes, summing matrices, and finding the transpose of a matrix.
design and analysis of algorithm Lab filesNitesh Dubey
This document contains details of experiments conducted as part of a "Design and Analysis of Algorithm Lab" course. It includes 10 experiments covering algorithms like binary search, heap sort, merge sort, selection sort, insertion sort, quick sort, knapsack problem, travelling salesman problem, minimum spanning tree (using Kruskal's algorithm), and N queen problem (using backtracking). For each experiment, it provides the objective, program code implementation, and result. The document is submitted by a student to their professor for the lab session.
Data Structure in C Programming LanguageArkadeep Dey
This document contains program code in C language for various operations on arrays, linked lists, and recursion. It includes programs for 1) creating and manipulating 1D and 2D arrays, 2) basic singly linked list operations like creation, traversal, counting nodes, insertion, deletion and reversal, 3) recursion based programs for factorial, GCD, Fibonacci series, tower of Hanoi and 4) menu driven programs to perform linked list operations like insertion and deletion at different positions. The programs demonstrate basic data structures concepts in C.
The document contains 14 code snippets demonstrating various array operations and sorting algorithms in C/C++, including:
1) Inserting an element into an array
2) Deleting an element from an array
3) Traversing the elements of an array
4) Implementing bubble sort, selection sort, and insertion sort algorithms
5) Performing linear and binary searches on arrays
6) Pushing and popping elements from a stack
7) Inserting elements into a queue
8) Merging two arrays
9) Converting an infix notation expression to postfix notation
The document contains C code examples demonstrating various array operations including:
1) Defining and initializing a single dimensional array, printing its elements, and sorting the array using selection sort.
2) Implementing linear and binary search algorithms to search for elements in an array.
3) Defining and initializing a double dimensional (2D) array and printing its elements.
The document contains a data structures lab manual with experiments on various data structure topics like arrays, stacks, queues, linked lists, and binary search trees. It includes C programs and explanations for inserting and deleting elements from arrays, stacks and queues. It also includes programs for matrix operations, sparse matrix representation, linear and binary searches. The experiments cover basic operations on common data structures.
The document contains 20 programs demonstrating various C programming concepts like data types, operators, control structures, functions, arrays, structures, pointers and data structures. Program 1 shows the use of arithmetic operators to add two numbers. Program 2 demonstrates logical operators in an if-else statement to find the greatest of three numbers. Program 3 uses relational operators in an if-else statement to check if a number is even or odd.
The document contains programs for various data structures and algorithms concepts in C language. It includes programs for 1) array operations using menu driven program, 2) string operations like pattern matching, 3) stack operations using array implementation, 4) infix to postfix conversion, 5) evaluation of postfix expression and tower of Hanoi problem using stack, 6) circular queue operations using array, 7) linked list operations on student data, and 8) doubly linked list operations on employee data. Each section provides the full code for a menu driven program to perform various operations on the given data structure.
Concept of Economic Zology.pdfhhhhhhhhhhhhhhseeratehsan08
Excellent — let’s expand it further with additional headings, subpoints, and a bit more detailing under each section. Here’s a richer, detailed assignment version you could use:
---
## 📖 **Detailed Assignment on Sclerenchyma Tissue**
---
### 📝 **Introduction to Plant Tissues**
Plants possess different types of tissues for performing various physiological and structural functions. Broadly, plant tissues are categorized into:
- **Meristematic tissues** (actively dividing)
- **Permanent tissues** (non-dividing, mature)
Permanent tissues are further classified into:
1. **Simple permanent tissues** — made up of only one type of cell
2. **Complex permanent tissues** — made up of more than one type of cell
Among **simple permanent tissues**, there are:
- Parenchyma
- Collenchyma
- Sclerenchyma
This assignment focuses on **Sclerenchyma Tissue**.
---
### 📖 **Definition of Sclerenchyma**
**Sclerenchyma** is a type of **simple permanent plant tissue** consisting of dead, thick-walled, lignified cells that provide mechanical support and strength to the plant body, especially in parts that have stopped growing.
---
### 🔬 **Characteristics of Sclerenchyma Tissue**
- Made up of **dead cells** at maturity.
- Cells have **thick, secondary cell walls** impregnated with **lignin** (a complex organic polymer).
- **Cell lumen (central cavity)** is either very narrow or absent.
- No **intercellular spaces** between sclerenchyma cells.
- The walls often contain **simple or bordered pits**.
- Arranged as bundles, continuous layers, or isolated cells.
- Provides **maximum mechanical strength** among all plant tissues.
---
### 📝 **Structure of Sclerenchyma Cells**
- **Shape:** May be elongated, narrow, isodiametric, or irregular.
- **Wall:** Thick, lignified, with simple or bordered pits.
- **Lumen:** Very narrow or obliterated.
- **Living Status:** Dead at maturity due to absence of protoplasm.
- **Special Feature:** Impregnation with **lignin** makes the wall hard, waterproof, and rigid.
---
### 📚 **Types of Sclerenchyma Tissue**
Based on shape, size, and occurrence, sclerenchyma is classified into:
#### **1️⃣ Fibres**
- **Structure:** Long, narrow, tapering at both ends.
- **Size:** Can be several millimeters in length.
- **Cell Wall:** Thick and lignified.
- **Lumen:** Narrow.
- **Occurrence:** Found in stems, leaves, fruits, and vascular bundles.
- **Examples:** Jute, flax, hemp fibres.
- **Function:** Provide **tensile strength and flexibility**.
#### **2️⃣ Sclereids (Stone Cells)**
- **Structure:** Short, isodiametric or irregularly shaped.
- **Cell Wall:** Very thick, often layered.
- **Lumen:** Small or obliterated.
- **Occurrence:** Found in seed coats, nutshells, pericarp of fruits, and leaves.
- **Examples:** Gritty texture in guava, pear; hard covering in nuts.
- **Function:** Provide **hardness and protection**.
---
### 📌 **Functions of Sclerenchyma Tissue**
- Provides **mechanical strength and rigidity** to plant organs.
- Enables
Career Planning After Class XII: Your Roadmap to SuccessDr. Radhika Sharma
Title:
Career Planning After Class XII: Your Roadmap to Success
Description:
Choosing the right career after Class XII is one of the most important decisions in a student's life. This presentation provides a comprehensive guide to career planning, covering various streams such as Science, Commerce, and Humanities. It highlights emerging fields, top courses, leading colleges, and tips on how students can make informed career choices based on their interests, skills, and aspirations.
Whether you're a student, parent, or educator, this PPT serves as a valuable resource for career awareness and decision-making.
Topics Covered:
Importance of Career Planning
Traditional vs. Emerging Career Options
Courses and Colleges after XII
Career Options Stream-wise (Science, Commerce, Arts)
Vocational and Professional Pathways
Tips for Smart Career Decision-Making
Future Trends in Careers
Uploaded to help students build a clear, confident, and successful future.
1617 SEEART EHSAN HUMAN GENffETICS.pptxseeratehsan08
Excellent — let’s expand it further with additional headings, subpoints, and a bit more detailing under each section. Here’s a richer, detailed assignment version you could use:
---
## 📖 **Detailed Assignment on Sclerenchyma Tissue**
---
### 📝 **Introduction to Plant Tissues**
Plants possess different types of tissues for performing various physiological and structural functions. Broadly, plant tissues are categorized into:
- **Meristematic tissues** (actively dividing)
- **Permanent tissues** (non-dividing, mature)
Permanent tissues are further classified into:
1. **Simple permanent tissues** — made up of only one type of cell
2. **Complex permanent tissues** — made up of more than one type of cell
Among **simple permanent tissues**, there are:
- Parenchyma
- Collenchyma
- Sclerenchyma
This assignment focuses on **Sclerenchyma Tissue**.
---
### 📖 **Definition of Sclerenchyma**
**Sclerenchyma** is a type of **simple permanent plant tissue** consisting of dead, thick-walled, lignified cells that provide mechanical support and strength to the plant body, especially in parts that have stopped growing.
---
### 🔬 **Characteristics of Sclerenchyma Tissue**
- Made up of **dead cells** at maturity.
- Cells have **thick, secondary cell walls** impregnated with **lignin** (a complex organic polymer).
- **Cell lumen (central cavity)** is either very narrow or absent.
- No **intercellular spaces** between sclerenchyma cells.
- The walls often contain **simple or bordered pits**.
- Arranged as bundles, continuous layers, or isolated cells.
- Provides **maximum mechanical strength** among all plant tissues.
---
### 📝 **Structure of Sclerenchyma Cells**
- **Shape:** May be elongated, narrow, isodiametric, or irregular.
- **Wall:** Thick, lignified, with simple or bordered pits.
- **Lumen:** Very narrow or obliterated.
- **Living Status:** Dead at maturity due to absence of protoplasm.
- **Special Feature:** Impregnation with **lignin** makes the wall hard, waterproof, and rigid.
---
### 📚 **Types of Sclerenchyma Tissue**
Based on shape, size, and occurrence, sclerenchyma is classified into:
#### **1️⃣ Fibres**
- **Structure:** Long, narrow, tapering at both ends.
- **Size:** Can be several millimeters in length.
- **Cell Wall:** Thick and lignified.
- **Lumen:** Narrow.
- **Occurrence:** Found in stems, leaves, fruits, and vascular bundles.
- **Examples:** Jute, flax, hemp fibres.
- **Function:** Provide **tensile strength and flexibility**.
#### **2️⃣ Sclereids (Stone Cells)**
- **Structure:** Short, isodiametric or irregularly shaped.
- **Cell Wall:** Very thick, often layered.
- **Lumen:** Small or obliterated.
- **Occurrence:** Found in seed coats, nutshells, pericarp of fruits, and leaves.
- **Examples:** Gritty texture in guava, pear; hard covering in nuts.
- **Function:** Provide **hardness and protection**.
---
### 📌 **Functions of Sclerenchyma Tissue**
- Provides **mechanical strength and rigidity** to plant organs.
- Enables
presentation of Requirements of a good test..pptxerramimaryam7
This presentation explains the key requirements of a good test, including validity, reliability, practicality, and more. It is intended for educaters, language teachers, and anyone interested in effective assessment design.
Latest Questions & Answers | Prepare for H3C GB0-961 CertificationNWEXAM
Start here---https://shorturl.at/ojpjM---Get complete detail on GB0-961 exam guide to crack H3C Certified Specialist for Intelligent Management Center (H3CS-iMC). You can collect all information on GB0-961 tutorial, practice test, books, study material, exam questions, and syllabus. Firm your knowledge on H3C Certified Specialist for Intelligent Management Center (H3CS-iMC) and get ready to crack GB0-961 certification. Explore all information on GB0-961 exam with number of questions, passing percentage and time duration to complete test.
2. PROGRAM TO PRINT 1D ARRAY
#include<stdio.h>
#include<conio.h>
void main()
{
int A[8]={1,2,6,4,88,55,43,21};
int i;
clrscr();
printf("The elements in the array Are :");
for(i=0;i<8;i++)
{
printf(" %d ",A[i]);
}
getch();
}
3. PROGRAM TO INSERT AN ELEMENT IN THE ARRAY AT A SPECIFIED POSITION
#include<stdio.h>
#include<conio.h>
void main()
{
int array[100], position, c, n, value;
clrscr();
printf("Enter number of elements in array n");
scanf("%d", &n);
printf("Enter %d elements n", n);
for (c = 0; c<n; c++)
scanf("%d", &array[c]);
printf("Enter the location where you wish to insert an element
n");
scanf("%d", &position);
printf("Enter the value to insert n");
scanf("%d", &value);
for (c = n - 1; c < position - 1; c--)
array[c+1] = array[c];
array[position-1] = value;
printf("Resultant array is: n");
for (c = 0; c < n; c++)
printf("%d ", array[c]);
getch();
}
5. PROGRAM TO DELETE AN ELEMENT FROM THE ARRAY
#include <stdio.h>
#include<conio.h>
void main()
{
int array[100], position, c, n;
clrscr();
printf("Enter number of elements in arrayn");
scanf("%d", &n);
printf("Enter %d elementsn", n);
for ( c = 0 ; c < n ; c++ )
scanf("%d", &array[c]);
printf("Enter the location where you wish to delete elementn");
scanf("%d", &position);
if ( position >= n+1 )
printf("Deletion not possible.n");
else
{
for ( c = position - 1 ; c < n - 1 ; c++ )
array[c] = array[c+1];
printf("Resultant array isn");
for( c = 0 ; c < n - 1 ; c++ )
printf("%dn", array[c]);
}
getch();
}
7. LINEAR SEARCHING
#include <stdio.h>
#include<conio.h>
void main()
{
int array[100], search, c, n;
clrscr();
printf("Enter the number of elements in arrayn");
scanf("%d", &n);
printf("Enter %d integer(s)n", n);
for (c = 0; c < n; c++)
scanf("%d", &array[c]);
printf("Enter a number to searchn");
scanf("%d", &search);
for (c = 0; c < n; c++)
{
if (array[c] == search) /* If required element is found */
{
printf("%d is present at location %d.n", search, c+1);
break;
}
}
if (c == n)
printf("%d isn't present in the array.n", search);
getch();
}
9. PROGRAM TO DISPLAY THE NUMBER OF OCCURENCES OF
AN ELEMENT IN AN ARRAY
#include<stdio.h>
#include<conio.h>
void main()
{
int array[100], search, c, n, count = 0;
clrscr();
printf("Enter the number of elements in arrayn");
scanf("%d",&n);
printf("Enter %d numbersn", n);
for ( c = 0 ; c < n ; c++ )
scanf("%d",&array[c]);
printf("Enter the number to searchn");
scanf("%d",&search);
for ( c = 0 ; c < n ; c++ )
{
if ( array[c] == search )
{
printf("%d is present at location %d.n", search, c+1);
count++;
}
}
if ( count == 0 )
printf("%d is not present in array.n", search);
else
printf("%d is present %d times in array.n", search, count);
getch();
}
10. BUBBLE SORT
#include<conio.h>
#include<stdio.h>
void main()
{
int i,j,n,a[100],temp;
clrscr();
printf("Enter the number of digits = ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("Enter the number = ");
scanf("%d",&a[i]);
}
for(i=1;i<n;i++)
{
for(j=0;j<(n-i);j++)
{
if(a[j]>a[j+1])
{
temp=a[j];
a[j]=a[j+1];
a[j+1]=temp;
}
}
}
printf("tThe sorted Array Is:n");
for(i=0;i<n;i++)
{
printf( "%d ",a[i]);
}
getch();
}
12. INSERTION SORT
#include<stdio.h>
#include<conio.h>
void main()
{
int a[100],i,j,k,n;
clrscr();
printf("Enter the total numbers you have to enter = ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("Enter the number = ");
scanf("%d",&a[i]);
}
for(i=0;i<n;i++)
{
k=a[i];
for(j=i-1;j>=0 && k<a[j];j--)
{
a[j+1]=a[j];
}
a[j+1]=k;
}
printf("Sorted Array:n");
for(i=0;i<n;i++)
{
printf("%d",a[i]);
printf("n");
}
getch();
}
13. SELECTION SORT
#include<stdio.h>
#include<conio.h>
void main()
{
int a[100],n,i,j,min,temp;
clrscr();
printf("n Enter the Number of Elements: ");
scanf("%d", &n);
printf("n Enter %d Elements: ",n);
for(i=0;i<n;i++)
{
scanf("%d",&a[i]);
}
for(i=0;i<n-1;i++)
{
min=i;
for(j=i+1;j<n;j++)
{
if(a[min]>a[j])
min=j;
}
if(min!=i)
{
temp=a[i];
a[i]=a[min];
a[min]=temp;
}
}
printf("n The Sorted array in ascending order: ");
for(i=0;i<n;i++)
{
printf("%d ",a[i]);
}
getch();
}
15. MERGE SORT
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
#define n 10
int ar[n];
int temp[n];
void mergesort(int[],int,int);
void merge( int , int , int , int);
void main()
{
int l,h,i;
clrscr();
l=0;
h=n-1;
for(i=0;i<n;i++)
{
printf("Enter the Number = ");
scanf("%d",&ar[i]);
}
mergesort(ar,l,h);
printf("The sorted Array:n");
for(i=0;i<n;i++)
{
printf("t");
printf("%d",ar[i]);
printf("n");
}
getch();
}
void mergesort(int ar[],int l, int h)
{
int m;
if(l<h)
{
m=(l+h)/2;
mergesort(ar,l,m);
mergesort(ar,m+1,h);
merge(l,m,m+1,h);
}
}
void merge(int p, int q , int r , int s )
{
int i,j,k;
i=p;
j=r;
k=p;
while(i<=q && j<=s)
{
if(ar[i]<ar[j])
17. QUEUES
#include<stdio.h>
#include<conio.h>
#define MAX 50
int que_arr[MAX];
int rear=-1;
int front=-1;
void main()
{
int choice;
clrscr();
while(1)
{
printf("1.Insert element to queue n");
printf("2. Delete element from queue n");
printf("3. Display all elements of queue n");
printf("4. Quit n");
printf("Enter your choice");
scanf("%d", &choice);
switch(choice)
{
case 1: insert();
break;
case 2: del();
break;
case 3: display();
break;
case 4: exit(1);
default: printf("Wrong Choice n");
}
}
}
insert()
{
int add_item;
if(rear == MAX-1)
printf("Queue Overflow n");
else
{
if(front == -1)
front=0;
printf("insert the element in queue : ");
scanf("%d",&add_item);
rear=rear+1;
18. que_arr[rear]=add_item;
}
}
del()
{
if(front == -1 || front>rear)
{
printf("Queue Underlow n");
return;
}
else
{
printf("Element deleted from queue is : %dn",que_arr[front]);
front=front+1;
}
}
display()
{
int i;
if (front == -1)
printf("Queue is empty n");
else
{
printf("Queue is : n");
for(i=front; i<=rear; i++)
printf(" %d ",que_arr[i]);
printf("n");
}
}
20. STACKS
#include<stdio.h>
#include<conio.h>
int s[10];
int top= -1;
void main()
{
int ch,el;
int ans;
void push(int);
int pop();
void display();
clrscr();
do
{
printf("MENUn");
printf("press 1 for pushn");
printf("press 2 for popn");
printf("press 3 for displayn");
printf("enter your choicen");
scanf("%d",&ch);
switch(ch)
{
case 1: if(top==9)
{
printf("stack overflow");
}
else
{
printf("enter the element to be pushed");
scanf("%d",&el);
push(el);
}
break;
case 2: if(top==-1)
{
printf("stack underflow");
}
else
{
printf("the deleted element is %d n", pop());
}
break;
case 3: display();
break;
default: printf("wrong choicen");
}
printf("n do you want to continue : 5 for yes , 6 for no");
scanf("%d",&ans);
23. SINGLY LINKED LIST
#include<stdio.h>
#include<conio.h>
#include<malloc.h>
#include<process.h>
//Structure declaration for the node
struct node
{
int info;
struct node *link;
}*start;
//This function will create a new linked list
void Create_List(int data)
{
struct node *q,*tmp;
//Dynamic memory is been allocated for a node
tmp= (struct node*)malloc(sizeof(struct node));
tmp->info=data;
tmp->link=NULL;
if(start==NULL) /*If list is empty*/
start=tmp;
else
{ /*Element inserted at the end*/
q=start;
while(q->link!=NULL)
q=q->link;
24. q->link=tmp;
}
}/*End of create_list()*/
//This function will add new element at the beginning of the linked
list
void AddAtBeg(int data)
{
struct node *tmp;
tmp=(struct node*)malloc(sizeof(struct node));
tmp->info=data;
tmp->link=start;
start=tmp;
}/*End of addatbeg()*/
//Following function will add new element at any position
void AddAfter(int data,int pos)
{
struct node *tmp,*q;
int i;
q=start;
//Finding the position to add new element to the linked list
for(i=0;i<pos-1;i++)
{
q=q->link;
if(q==NULL)
{
printf ("nn There are less than %d elements",pos);
getch();
25. return;
}
}/*End of for*/
tmp=(struct node*)malloc(sizeof (struct node));
tmp->link=q->link;
tmp->info=data;
q->link=tmp;
}/*End of addafter()*/
//Delete any element from the linked list
void Del(int data)
{
struct node *tmp,*q;
if (start->info == data)
{
tmp=start;
start=start->link; /*First element deleted*/
free(tmp);
return;
}
q=start;
while(q->link->link != NULL)
{
if(q->link->info == data) /*Element deleted in between*/
{
tmp=q->link;
q->link=tmp->link;
free(tmp);
26. return;
}
q=q->link;
}/*End of while */
if(q->link->info==data) /*Last element deleted*/
{
tmp=q->link;
free(tmp);
q->link=NULL;
return;
}
printf ("nnElement %d not found",data);
getch();
}/*End of del()*/
//This function will display all the element(s) in the linked list
void Display()
{
struct node *q;
if(start == NULL)
{
printf ("nnList is empty");
return;
}
q=start;
printf("nnList is : ");
while(q!=NULL)
{
27. printf ("%d ", q->info);
q=q->link;
}
printf ("n");
getch();
}/*End of display() */
//Function to count the number of nodes in the linked list
void Count()
{
struct node *q=start;
int cnt=0;
while(q!=NULL)
{
q=q->link;
cnt++;
}
printf ("Number of elements are %dn",cnt);
getch();
}/*End of count()*/
//Function to search an element from the linked list
void Search(int data)
{
struct node *ptr = start;
int pos = 1;
//searching for an element in the linked list
while(ptr!=NULL)
28. {
if (ptr->info==data)
{
printf ("nnItem %d found at position %d", data, pos);
getch();
return;
}
ptr = ptr->link;
pos++;
}
if (ptr == NULL)
printf ("nnItem %d not found in list",data);
getch();
}
void main()
{
int choice,n,m,position,i;
start=NULL;
while(1)
{
clrscr();
printf ("1.Create Listn");
printf ("2.Add at beginningn");
printf ("3.Add after n");
printf ("4.Deleten");
printf ("5.Displayn");
printf ("6.Countn");
29. printf ("7.Searchn");
printf ("8.Quitn");
printf ("nEnter your choice:");
scanf ("%d",&choice);
switch (choice)
{
case 1:
printf ("nnHow many nodes you want:");
scanf ("%d",&n);
for(i = 0;i<n;i++)
{
printf ("nEnter the element:");
scanf ("%d",&m);
Create_List(m);
}
break;
case 2:
printf ("nnEnter the element : ");
scanf ("%d",&m);
AddAtBeg(m);
break;
case 3:
printf ("nnEnter the element:");
scanf ("%d",&m);
printf ("nEnter the position after which this element is inserted:");
scanf ("%d",&position);
AddAfter(m,position);
30. break;
case 4:
if (start == NULL)
{
printf("nnList is empty");
continue;
}
printf ("nnEnter the element for deletion:");
scanf ("%d",&m);
Del(m);
break;
case 5:
Display();
break;
case 6:
Count();
break;
case 7:
printf("nnEnter the element to be searched:");
scanf ("%d",&m);
Search(m);
break;
case 8:
exit(0);
default:
printf ("nnWrong choice");
34. STACK IMPLEMENTATION USING LINKED LIST
#include<conio.h>
#include<stdio.h>
#include<malloc.h>
#include<process.h>
//Structure is created a node
struct node
{
int info;
struct node *link;//A link to the next node
};
//A variable named NODE is been defined for the structure
typedef struct node *NODE;
//This function is to perform the push operation
NODE push(NODE top)
{
NODE NewNode;
int pushed_item;
//A new node is created dynamically
NewNode = (NODE)malloc(sizeof(struct node));
printf("nInput the new value to be pushed on the stack:");
scanf("%d",&pushed_item);
NewNode->info=pushed_item;//Data is pushed to the stack
NewNode->link=top;//Link pointer is set to the next node
35. top=NewNode;//Top pointer is set
return(top);
}/*End of push()*/
//Following function will implement the pop operation
NODE pop(NODE top)
{
NODE tmp;
if(top == NULL)//checking whether the stack is empty or not
printf ("nStack is emptyn");
else
{
tmp=top;//popping the element
printf("nPopped item is %d n",tmp->info);
top=top->link;//resetting the top pointer
tmp->link=NULL;
free(tmp);//freeing the popped node
}
return(top);
}/*End of pop()*/
//This is to display the entire element in the stack
void display(NODE top)
{
if(top==NULL)
printf("nStack is emptyn");
else
{
printf("nStack elements:n");
36. while(top != NULL)
{
printf("%dn",top->info);
top = top->link;
}/*End of while */
}/*End of else*/
}/*End of display()*/
void main()
{
char opt;
int choice;
NODE Top=NULL;
do
{
clrscr();
printf("n1.PUSHn");
printf("2.POPn");
printf("3.DISPLAYn");
printf("4.EXITn");
printf("nEnter your choice:");
scanf("%d", &choice);
switch(choice)
{
case 1:
Top=push(Top);
break;
case 2:
39. QUEUE IMPLEMENTATION USING LINKED LIST
//THIS PROGRAM WILL IMPLEMENT ALL THE OPERATIONS
//OF THE QUEUE, IMPLEMENTED USING LINKED LIST
//CODED AND COMPILED IN TURBO C
#include<stdio.h>
#include<conio.h>
#include<malloc.h>
//A structure is created for the node in queue
struct queu
{
int info;
struct queu *next;//Next node address
};
typedef struct queu *NODE;
//This function will push an element into the queue
NODE push(NODE rear)
{
NODE NewNode;
//New node is created to push the data
NewNode=(NODE)malloc(sizeof(struct queu));
printf ("nEnter the no to be pushed = ");
scanf ("%d",&NewNode->info);
NewNode->next=NULL;
//setting the rear pointer
40. if (rear != NULL)
rear->next=NewNode;
rear=NewNode;
return(rear);
}
//This function will pop the element from the queue
NODE pop(NODE f,NODE r)
{
//The Queue is empty when the front pointer is NULL
if(f==NULL)
printf ("nThe Queue is empty");
else
{
printf ("nThe poped element is = %d",f->info);
if(f != r)
f=f->next;
else
f=NULL;
}
return(f);
}
//Function to display the element of the queue
void traverse(NODE fr,NODE re)
{
//The queue is empty when the front pointer is NULL
if (fr==NULL)
41. printf ("nThe Queue is empty");
else
{
printf ("nThe element(s) is/are = ");
while(fr != re)
{
printf("%d ",fr->info);
fr=fr->next;
};
printf ("%d ",fr->info);
}
}
void main()
{
int choice;
char option;
//declaring the front and rear pointer
NODE front, rear;
//Initializing the front and rear pointer to NULL
front = rear = NULL;
do
{
clrscr();
printf ("1. Pushn");
printf ("2. Popn");
printf ("3. Traversen");
printf ("nnEnter your choice = ");
42. scanf ("%d",&choice);
switch(choice)
{
case 1:
//calling the push function
rear = push(rear);
if (front==NULL)
{
front=rear;
}
break;
case 2:
//calling the pop function by passing
//front and rear pointers
front = pop(front,rear);
if (front == NULL)
rear = NULL;
break;
case 3:
traverse(front,rear);
break;
}
printf ("nnPress (Y/y) to continue = ");
fflush(stdin);
scanf ("%c",&option);
}while(option == 'Y' || option == 'y'); }
45. DOUBLY LINKED LIST
#include<conio.h>
#include<stdio.h>
#include<malloc.h>
#include<process.h>
//Structure is created for the node
struct node
{
struct node *prev;
int info;
struct node *next;
}*start;
typedef struct node *NODE;
//fucntion to create a doubly linked list
void create_list(int num)
{
NODE q,tmp;
//a new node is created
tmp=(NODE)malloc(sizeof(struct node));
tmp->info=num;//assigning the data to the new node
tmp->next=NULL;
if(start==NULL)
{
tmp->prev=NULL;
47. NODE tmp,q;
int i;
q=start;
//Finding the position to be inserted
for(i=0;i<pos-1;i++)
{
q=q->next;
if(q==NULL)
{
printf ("nThere are less than %d elementsn",pos);
return;
}
}
//a new node is created
tmp=(NODE)malloc(sizeof(struct node) );
tmp->info=num;
q->next->prev=tmp;
tmp->next=q->next;
tmp->prev=q;
q->next=tmp;
}/*End of addafter() */
//Function to delete a node
void del(int num)
{
NODE tmp,q;
if(start->info==num)
{
48. tmp=start;
start=start->next; /*first element deleted*/
start->prev = NULL;
free(tmp);//Freeing the deleted node
return;
}
q=start;
while(q->next->next!=NULL)
{
if(q->next->info==num) /*Element deleted in between*/
{
tmp=q->next;
q->next=tmp->next;
tmp->next->prev=q;
free(tmp);
return;
}
q=q->next;
}
if (q->next->info==num) /*last element deleted*/
{ tmp=q->next;
free(tmp);
q->next=NULL;
return;
}
printf("nElement %d not foundn",num);
}/*End of del()*/
49. //Displaying all data(s) in the node
void display()
{
NODE q;
if(start==NULL)
{
printf("nList is emptyn");
return;
}
q=start;
printf("nList is :n");
while(q!=NULL)
{
printf("%d ", q->info);
q=q->next;
}
printf("n");
}/*End of display() */
//Function to count the number of nodes in the linked list
void count()
{
NODE q=start;
int cnt=0;
while(q!=NULL)
{
q=q->next;
50. cnt++;
}
printf("nNumber of elements are %dn",cnt);
}/*End of count()*/
//Reversing the linked list
void main()
{
int choice,n,m,po,i;
start=NULL;
while(1)
{
//Menu options for the doubly linked list operation
clrscr();
printf("n1.Create Listn");
printf("2.Add at beginingn");
printf("3.Add aftern");
printf("4.Deleten");
printf("5.Displayn");
printf("6.Countn");
printf("7.Exitn");
printf("nEnter your choice:");
scanf("%d",&choice);
//switch instruction is called to execute
//correspoding function
switch(choice)
51. {
case 1:
printf("nHow many nodes you want:");
scanf("%d",&n);
for(i=0;i<n;i++)
{
printf("nEnter the element:");
scanf("%d",&m);
//create linked list function is called
create_list(m);
}
break;
case 2:
printf("nEnter the element:");
scanf("%d",&m);
addatbeg(m);
break;
case 3:
printf("nEnter the element:");
scanf("%d",&m);
printf("nEnter the position after which this element is inserted:");
scanf("%d",&po);
addafter(m,po);
break;
case 4:
printf("nEnter the element for deletion:");
scanf("%d",&m);
52. //Delete a node fucntion is called
del(m);
break;
case 5:
display();
getch();
break;
case 6:
count();
getch();
break;
case 7:
exit(0);
break;
default:
printf("nWrong choicen");
getch();
}/*End of switch*/
}/*End of while*/
}/*End of main()*/
54. CIRCULAR LINKED LIST
#include<stdio.h>
#include<stdlib.h>
typedef struct Node
{
int info;
struct Node *next;
}node;
node *front=NULL,*rear=NULL,*temp;
void create();
void del();
void display();
int main()
{
int chc;
do
{
printf("nMenunt 1 to create the element : ");
printf("nt 2 to delete the element : ");
printf("nt 3 to display the queue : ");
55. printf("nt 4 to exit from main : ");
printf("nEnter your choice : ");
scanf("%d",&chc);
switch(chc)
{
case 1:
create();
break;
case 2:
del();
break;
case 3:
display();
break;
case 4:
return 1;
default:
printf("nInvalid choice :");
}
}while(1);
return 0;
60. INFIX TO POSTFIX CONVERSION
#include<stdio.h>
#include<conio.h>
#include<string.h>
//Defining the maximum size of the stack
#define MAXSIZE 100
//Declaring the stack array and top variables in a structure
struct stack
{
char stack[MAXSIZE];
int Top;
};
//type definition allows the user to define an identifier that would
//represent an existing data type. The user-defined data type
identifier
//can later be used to declare variables.
typedef struct stack NODE;
//This function will add/insert an element to Top of the stack
void push(NODE *pu,char item)
{
//if the top pointer already reached the maximum allowed size then
//we can say that the stack is full or overflow
if (pu->Top == MAXSIZE-1)
{
printf("nThe Stack Is Full");
getch();
61. }
//Otherwise an element can be added or inserted by
//incrementing the stack pointer Top as follows
else
pu->stack[++pu->Top]=item;
}
//This function will delete an element from the Top of the stack
char pop(NODE *po)
{
char item='#';
//If the Top pointer points to NULL, then the stack is empty
//That is NO element is there to delete or pop
if(po->Top == -1)
printf(" nThe Stack Is Empty. Invalid Infix expression ");
//Otherwise the top most element in the stack is poped or
//deleted by decrementing the Top pointer
else
item=po->stack[po->Top--];
return(item);
}
//This function returns the precedence of the operator
int prec(char symbol)
{
switch(symbol)
{
case '(':
return(1);
62. case ')':
return(2);
case '+':
case '-':
return(3);
case '*':
case '/':
case '%':
return(4);
case '^':
return(5);
default:
return(0);
}
}
//This function will return the postfix expression of an infix
void Infix_Postfix(char infix[])
{
int i,j;
int len,priority;
char postfix[MAXSIZE],ch;
//Declaring an pointer variable to the structure
NODE *ps;
//Initializing the Top pointer to NULL
ps->Top=-1;
//Finding length of the string
len=strlen(infix);
63. //At the end of the string inputting a parenthesis ')'
infix[len++]=')';
push(ps,'(');//Parenthesis is pushed to the stack
for( i=0,j=0;i<len;i++)
{
switch(prec(infix[i]))
{
//Scanned char is '(' push to the stack
case 1:
push(ps,infix[i]);
break;
//Scanned char is ')' pop the operator(s) and add to //the postfix
expression
case 2:
ch=pop(ps);
while(ch != '(')
{
postfix[j++]=ch;
ch=pop(ps);
}
break;
//Scanned operator is +,- then pop the higher or same
//precedence operator to add postfix before pushing
//the scanned operator to the stack
case 3:
ch=pop(ps);
while(prec(ch) >= 3)
64. {
postfix[j++]=ch;
ch=pop(ps);
}
push(ps,ch);
push(ps,infix[i]);
break;
//Scanned operator is *,/,% then pop the higher or
//same precedence operator to add postfix before
//pushing the scanned operator to the stack
case 4:
ch=pop(ps);
while(prec(ch) >= 4)
{
postfix[j++]=ch;
ch=pop(ps);
}
push(ps,ch);
push(ps,infix[i]);
break;
//Scanned operator is ^ then pop the same
//precedence operator to add to postfix before pushing
//the scanned operator to the stack
case 5:
ch=pop(ps);
while(prec(ch) == 5)
{
65. postfix[j++]=ch;
ch=pop(ps);
}
push(ps,ch);
push(ps,infix[i]);
break;
//Scanned char is a operand simply add to the postfix
//expression
default:
postfix[j++]=infix[i];
break;
}
}
//Printing the postfix notation to the screen
printf ("nThe Postfix expression is = ");
for(i=0;i<j;i++)
printf ("%c",postfix[i]);
}
void main()
{
char choice,infix[MAXSIZE];
do
{
clrscr();
printf("nnEnter the infix expression = ");
fflush(stdin);
gets(infix);//Inputting the infix notation
66. Infix_Postfix(infix);//Calling the infix to postfix function
printf("nnDo you want to continue (Y/y) =");
fflush(stdin);
scanf("%c",&choice);
}while(choice == 'Y' || choice == 'y');
}
67. EVALUATION OF POSTFIX EXPRESSION
#include<stdio.h> //standard input output functions
#include<conio.h> //console functions
#include<string.h> //string functions
#define MAX 50 //max size defined
int stack[MAX]; //a global stack
char post[MAX]; //a global postfix stack
int top=-1; //initializing top to -1
void pushstack(int tmp); //push function
void evaluate(char c); //calculate function
void main()
{
int i,l;
//clrscr();
printf("Insert a postfix notation :: ");
gets(post); //getting a postfix expression
l=strlen(post); //string length
for(i=0;i<l;i++)
{
if(post[i]>='0' && post[i]<='9')
{
pushstack(i); //if the element is a number push
it
}
if(post[i]=='+' || post[i]=='-' || post[i]=='*' ||
post[i]=='/' || post[i]=='^') //if element is an operator
{
68. evaluate(post[i]); //pass it to the evaluate
}
} //print the result from the top
printf("nnResult :: %d",stack[top]);
getch();
}
void pushstack(int tmp) //definiton for push
{
top++; //incrementing top
stack[top]=(int)(post[tmp]-48); //type casting the string to its
integer value
}
void evaluate(char c) //evaluate function
{
int a,b,ans; //variables used
a=stack[top]; //a takes the value stored in the top
stack[top]='0'; //make the stack top NULL as its a string
top--; //decrement top's value
b=stack[top]; //put the value at new top to b
stack[top]='0'; //make it NULL
top--; //decrement top
switch(c) //check operator been passed to evaluate
{
case '+': //addition
ans=b+a;
69. break;
case '-': //subtraction
ans=b-a;
break;
case '*': //multiplication
ans=b*a;
break;
case '/': //division
ans=b/a;
break;
case '^': //power
ans=b^a;
break;
default:
ans=0; //else 0
}
top++; //increment top
stack[top]=ans; //store the answer at top
}
71. BINARY SEARCH TREE
/*
* C Program to Construct a Binary Search Tree and perform deletion,
inorder traversal on it
*/
#include <stdio.h>
#include <stdlib.h>
struct btnode
{
int value;
struct btnode *l;
struct btnode *r;
}*root = NULL, *temp = NULL, *t2, *t1;
void delete1();
void insert();
void delete();
void inorder(struct btnode *t);
void create();
void search(struct btnode *t);
void preorder(struct btnode *t);
void postorder(struct btnode *t);
void search1(struct btnode *t,int data);
int smallest(struct btnode *t);
int largest(struct btnode *t);
72. int flag = 1;
void main()
{
int ch;
printf("nOPERATIONS ---");
printf("n1 - Insert an element into treen");
printf("2 - Delete an element from the treen");
printf("3 - Inorder Traversaln");
printf("4 - Preorder Traversaln");
printf("5 - Postorder Traversaln");
printf("6 - Exitn");
while(1)
{
printf("nEnter your choice : ");
scanf("%d", &ch);
switch (ch)
{
case 1:
insert();
break;
case 2:
delete();
break;
case 3:
inorder(root);
73. break;
case 4:
preorder(root);
break;
case 5:
postorder(root);
break;
case 6:
exit(0);
default :
printf("Wrong choice, Please enter correct choice ");
break;
}
}
}
/* To insert a node in the tree */
void insert()
{
create();
if (root == NULL)
root = temp;
else
search(root);
}
/* To create a node */
74. void create()
{
int data;
printf("Enter data of node to be inserted : ");
scanf("%d", &data);
temp = (struct btnode *)malloc(1*sizeof(struct btnode));
temp->value = data;
temp->l = temp->r = NULL;
}
/* Function to search the appropriate position to insert the new node
*/
void search(struct btnode *t)
{
if ((temp->value > t->value) && (t->r != NULL)) /* value more
than root node value insert at right */
search(t->r);
else if ((temp->value > t->value) && (t->r == NULL))
t->r = temp;
else if ((temp->value < t->value) && (t->l != NULL)) /* value
less than root node value insert at left */
search(t->l);
else if ((temp->value < t->value) && (t->l == NULL))
t->l = temp;
}
/* recursive function to perform inorder traversal of tree */
75. void inorder(struct btnode *t)
{
if (root == NULL)
{
printf("No elements in a tree to display");
return;
}
if (t->l != NULL)
inorder(t->l);
printf("%d -> ", t->value);
if (t->r != NULL)
inorder(t->r);
}
/* To check for the deleted node */
void delete()
{
int data;
if (root == NULL)
{
printf("No elements in a tree to delete");
return;
}
printf("Enter the data to be deleted : ");
scanf("%d", &data);
t1 = root;
76. t2 = root;
search1(root, data);
}
/* To find the preorder traversal */
void preorder(struct btnode *t)
{
if (root == NULL)
{
printf("No elements in a tree to display");
return;
}
printf("%d -> ", t->value);
if (t->l != NULL)
preorder(t->l);
if (t->r != NULL)
preorder(t->r);
}
/* To find the postorder traversal */
void postorder(struct btnode *t)
{
if (root == NULL)
{
printf("No elements in a tree to display ");
return;
}
77. if (t->l != NULL)
postorder(t->l);
if (t->r != NULL)
postorder(t->r);
printf("%d -> ", t->value);
}
/* Search for the appropriate position to insert the new node */
void search1(struct btnode *t, int data)
{
if ((data>t->value))
{
t1 = t;
search1(t->r, data);
}
else if ((data < t->value))
{
t1 = t;
search1(t->l, data);
}
else if ((data==t->value))
{
delete1(t);
}
}
/* To delete a node */
78. void delete1(struct btnode *t)
{
int k;
/* To delete leaf node */
if ((t->l == NULL) && (t->r == NULL))
{
if (t1->l == t)
{
t1->l = NULL;
}
else
{
t1->r = NULL;
}
t = NULL;
free(t);
return;
}
/* To delete node having one left hand child */
else if ((t->r == NULL))
{
if (t1 == t)
{
root = t->l;
t1 = root;
79. }
else if (t1->l == t)
{
t1->l = t->l;
}
else
{
t1->r = t->l;
}
t = NULL;
free(t);
return;
}
/* To delete node having right hand child */
else if (t->l == NULL)
{
if (t1 == t)
{
root = t->r;
t1 = root;
}
else if (t1->r == t)
t1->r = t->r;
else
t1->l = t->r;
80. t = NULL;
free(t);
return;
}
/* To delete node having two child */
else if ((t->l != NULL) && (t->r != NULL))
{
t2 = root;
if (t->r != NULL)
{
k = smallest(t->r);
flag = 1;
}
else
{
k =largest(t->l);
flag = 2;
}
search1(root, k);
t->value = k;
}
}
/* To find the smallest element in the right sub tree */
int smallest(struct btnode *t)
81. {
t2 = t;
if (t->l != NULL)
{
t2 = t;
return(smallest(t->l));
}
else
return (t->value);
}
/* To find the largest element in the left sub tree */
int largest(struct btnode *t)
{
if (t->r != NULL)
{
t2 = t;
return(largest(t->r));
}
else
return(t->value);
}