/* Programmed by: Jannath Khan*/
#include <iostream>
#include <string>
using namespace std;
bool isPalindrome(string input)
cfw_
int i = 0, str = input.length();/ declaring variable to read the input
if (str <= 1)/finding out if the string is greater than
a) Save this document with your name and the lab assignment number in the file
name, e.g., CSC1101_Lab06_Bill_Gates.docx.
b) Type/paste your answers into the document.
c) Submit this document to the Blackboard item where you downloaded this
document.
Part
Fundamental Structures Lab 9
March 20, 2017
Submission Instructions: This lab is due Wednesday, March 29, 2017. A lab submitted beyond the due
date will not be accepted except for a documentable and valid excuse. Upon completion you must upload
.m file (o
WAYNE S TATE U NIVERSITY
C OMPUTER S CIENCE D EPARTMENT
Lab 03
Arrays
Airplane Seating Assignment
Write a program that can be used to show available seats for a commercial airplane. The
airplane has 13 rows with six seats in each row. Rows 1 and 2 are fir
CSC 1100 Problem Solving and Programming
Homework 1 [Noman Haider]
25 points Due September 15, 4pm
Late deadline is September 17, 11:59pm, but 20% off
a) Save this document with your name and the homework number somewhere in
the file name.
b) Type/paste y
CSC 1500
Fundamental Structures
Home Work No. 6 Solution
Winter 2017
1) Let A = Z+, the set of positive integers, and let R = cfw_(a, b) A A | a divides b. What is R?
*c. Antisymmetric
2) Let A = cfw_1,2,3,4. Which of the following is true about the relat
1.
This chapter uses the class rectangleType to illustate how to overload the
operators +, *, =, !=, >, and <. In this exercise, first redefine
the class rectangleType by declaring the instance variables as protected and
then overload additional operators
a) Save this document with your name and the lab assignment number in the file
name, e.g., CSC1101_Lab01_Bill_Gates.docx.
b) Type/paste your answers into the document.
c) Submit this document to the Blackboard item where you downloaded this
document.
Q1.
a) Save this document with your name and the lab assignment number in the file
name, e.g., CSC1101_Lab02_Bill_Gates.docx.
b) Type/paste your answers into the document.
c) Submit this document to the Blackboard item where you downloaded this
document.
Q1.
CSC 1500
Fundamental Structure
Winter 2017
Homework #5 (Due February 28, 2017)
Q. 1 Maximum score = 25 (parts (a) and (b) 5 points, part (c) 15 points)
(a) Use a direct proof to show that the product of two odd numbers is odd.
(b) Prove that there are no
WAYNE S TATE U NIVERSITY
C OMPUTER S CIENCE D EPARTMENT
Lab 02
Namespaces, the class string and User-Defined Simple Data Types
Removing Vowels from an String
Write a program that prompts the user to input a string. The program then uses the function
subst
CSC 1500
Fundamental Structures
Winter 2017
Homework No. 9 (Due April 11, 2017)
Q. 1. Maximum score 25 (5 points each part)
Calculate (a) A(B+C), (b) A(B-C), (c) (B+C)A, (d) ABC, and (e) 2(AB - C) for
the following matrices: A = (2 0; 1 2); B = (-1 2; 3 2
Fundamental Structures Lab 10
March 28, 2017
Submission Instructions: This lab is due one week from the day it is assigned. A lab submitted beyond the due date will not be accepted except for a documentable and valid excuse. Upon
completion you must uploa
import random
import sys
def mimic_dict(filename):
dict1 = cfw_
f = open(filename,'mimic.txt')
text = (f.read().split()
f.close()
text=[0]
global c
c = text[0]
for i in range(len(text)-1):
if text[i] in dict1.keys():
dict1[text[i] += [text[i+1]
else:
dict
Nodes and Linked Lists
A linked list is a list that can grow and shrink while the program is running
A linked list is constructed using pointers
A linked list often consists of structs or classes that contain a pointer variable connecting them
to other dy
Pointers
What Size Array Should Be?
If it is too small, it might get filled up. If it is too large, many clients will only use a small fraction of the
array space, and we will be wasting memory. The best approach might be to start an array off as small,
t
April 06, 2017
O() Analysis of methods and Data Structures(25% of final exam)
Break algorithm down into KNOWN pieces
Identify relationships between pieces
Drop constants
Keep only dominant factor for each variable
We need to know what N is in advance to d
The List ADT
A list is a list of elements
The list of elements consist of the data acted upon by list operations
A current position (or active position) in the list is also acted upon by list operations
List ADT Operations
insert, to insert a new item
Priority Queues
Not going to be on final
Queues are standard mechanism for ordering task on a first-come, first served basis.
However, some tasks may be more important or timely than others
Priority queues stores tasks using a partial ordering based on pr
Graphs
April 4, 2017
What is a graph?
Ans: a data structure that consists of a set of nodes (vertices) and a set of edges that relate
the nodes to each other.
The set of edges describes relationships among the vertices.
Formal Definition of graph
A graph
CSC2111
Warm-up 01
An introduction to the Visual C+
programming environment
1. Introduction to Visual C+.
Visual C+ comes within Microsoft Visual Studio. Visual Studio also contains Visual
Basic, Visual C#, and Visual J#. Using Visual Studio, you can mix
CSC 1101 Problem Solving and Programming Laboratory
Lab Assignment 07
25 points
a) Save this document with your name and the lab assignment number somewhere
in the file name.
b) Type/paste your answers into the document.
c) Submit this document to the Bl
Lab 1
1.
2.
3. a.
3.
b.
4. a. The TTT satisfies this because (p q), (q r), and (r p) all mean (T or not T) each which
is T, so our expression is now TTT which is saying T and T and T which is T.
b.
P
T
T
F
F
Q
T
F
T
F
P Q
T
F
T
T
P
T
T
F
F
Q
T
F
T
F
P Q
T
Fundamental Structures Lab 7
March 3, 2014
Submission Instructions: This lab will be due by Monday, March 10. A lab submitted beyond the
due date will not be accepted except for a documentable and valid excuse. Upon completion you must
upload MATLAB m or
Fundamental Structures Lab 9
March 19, 2014
Submission Instructions: This lab will be due by Wednesday, March 26. A lab submitted
beyond the due date will not be accepted except for a documentable and valid excuse. Upon completion you must upload MATLAB m
Fundamental Structures Lab 4
February 3, 2014
Submission Instructions: This lab is be due on Sunday, February 9. A lab submitted beyond
the due date will not be accepted except for a documentable and valid excuse. Upon completion
you must upload your MATL
Fundamental Structures Lab 8
March 5, 2014
Submission Instructions: This is an in-lab. Upon completion you must upload your MATLAB
m le to Blackboard using the following convention Username Lab#.m or C+ .cpp le by 7:20
PM today. Blackboard submissions don