Binary Tree Operations, Sorting Algorithms & CLL Pseudocode
Binary Tree Insert
1. ptr = ROOT; flag = FALSE
2. While (ptr != NULL) and (flag == FALSE) do
3. Case: ITEM < ptr->DATA
4. ptr1 = ptr
5. ptr = ptr->LCHILD
6. Case: ITEM > ptr->DATA
7. ptr1 = ptr
8. ptr = ptr->RCHILD
9. Case: ptr->DATA = ITEM
10. flag = TRUE
11. Print "ITEM already exists"
12. Exit
13. EndCase
14. EndWhile
15. If (ptr == NULL) then
16. new = GetNode(NODE)
17. new->DATA = ITEM
18. new->LCHILD = NULL
19. new->RCHILD Read More
C Programs: Tower of Hanoi and Singly Linked List
C Programs: Tower of Hanoi and Singly Linked List
Includes: Two C programs: a recursive Tower of Hanoi solver and a singly linked list implementation with stack demo. The original code has been preserved, formatted, and corrected for spelling, grammar, and readability.
Tower of Hanoi – C Program
#include <stdio.h>
void tower_hanoi(int n, char src, char dest, char temp) {
if (n == 1) {
printf("\nMove disk %d from peg %c to peg %c", n, src, dest);
return;
}
tower_hanoi( Read More
UML and System Modeling Techniques for Software Design
Chapter 5: System Modeling Fundamentals
System Modeling
- System modeling is the process of developing abstract models of a system, with each model presenting a different view or perspective of that system.
- System modeling has now come to mean representing a system using some kind of graphical notation, which is now almost always based on notations in the Unified Modeling Language (UML).
- System modeling helps the analyst to understand the functionality of the system, and models are used to communicate
C Implementation: Circular Linked List for Polynomials
C Implementation: 3D Polynomials with Circular Linked Lists
This code defines structures and functions to manage multivariate polynomials (in terms of $x, y, z$) using a circular linked list to store individual terms.
Data Structure Definition
struct node {
int coeff;
int x_exp, y_exp, z_exp;
struct node *next;
};A pointer to the first term is initialized:
struct node *poly1 = NULL;Term Insertion Function
insertTerm Function
Inserts a new term into the circular linked list. If the list is
Read MoreData Structure Algorithms: BST, Sort, and CLL Operations
Binary Tree Insertion
- ptr = ROOT, flag = FALSE
- While (ptr != NULL) and (flag = FALSE) do:
- Case: ITEM < ptr→DATA
- ptr1 = ptr
- ptr = ptr→LCHILD
- ptr1 = ptr
- ptr = ptr→RCHILD
- flag = TRUE
- Print “ITEM already exists”
- Exit
- new = GetNode(NODE)
- new→DATA = ITEM
- new→LCHILD = NULL
- new→RCHILD = NULL
- If (ptr1→DATA < ITEM) then
- ptr1→RCHILD = new
- Else
- ptr1→LCHILD = new
- EndIf
Binary Tree Deletion
- ptr = ROOT, flag = FALSE
- While
Essential Software Engineering Concepts: SQA, Agile, Testing, and Design Principles
Software Quality Assurance (SQA) and Its Types
What is SQA?
Software Quality Assurance (SQA) is a systematic process designed to prevent defects from happening in the first place, ensuring the final software meets required quality standards and user expectations. It covers activities like audits, reviews, and monitoring throughout the entire Software Development Life Cycle (SDLC). The main goal is to deliver reliable, efficient, and maintainable software.
Types of SQA
- Process Assurance: Ensures the
